package com.wysql.dalian.controller.getData;


import com.ejlchina.searcher.BeanSearcher;
import com.wysql.dalian.common.BaseController;
import com.wysql.dalian.service.DldpResultService;
import com.wysql.dalian.util.Head;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.*;

@Controller
@RequestMapping("/dw-service-xxl-screen/DldpResultController")
@RequiredArgsConstructor
@Component
@CrossOrigin(origins = "*")
public class DldpResultController extends BaseController {

    private final DldpResultService dldpResultService;

    private final BeanSearcher beanSearcher;

    @Value("${serviceUrl}")
    private String serviceUrl;

    //private static final String URL = "25.66.196.211:28777/dw-service-xxl-screen/ppt/";
    private static final String URL = "localhost:9055/dw-service-xxl-screen/ppt/";


    @RequestMapping("getSecondJson")
    @ResponseBody
    public Map<String, Object> getTableData(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> map = new LinkedHashMap<>();
        Map<String, Object> res = new LinkedHashMap<>();
        Map<String, Object> p0 = getStringObjectMapp0();
        Map<String, Object> intro = new LinkedHashMap<>();
        List<String> ppt = new ArrayList<>();
        String sql1 = "SELECT  tplj , CONCAT( 'http://" + URL + "', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = '4'";
        List<Map<String, Object>> introList = dldpResultService.queryInfoBySql(sql1);
        for (Map<String, Object> stringObjectMap : introList) {
            ppt.add(stringObjectMap.get("img").toString());
        }
        intro.put("ppt", ppt);

        Map<String, Object> p1 = getStringObjectMapp1();
        Map<String, Object> p3_1 = getStringObjectMapp3_1new();
        Map<String, Object> p3_2 = getStringObjectMapp3_2new();
        Map<String, Object> p4 = getStringObjectMapp4();
        Map<String, Object> p6_1 = getStringObjectMapp6_1new();


        Map<String, Object> p6_2 = getStringObjectMapp6_2();
        Map<String, Object> p6_3 = getStringObjectMapp6_3();
        Map<String, Object> resultMap5 = getStringObjectMapp2_4();

        Map<String, Object> resultMap = new HashMap<>();
        dldlLeftTop1(resultMap);
        dldlLeftTop2(resultMap);
        dldlLeftTop3(resultMap);
        dldlLeftTop4(resultMap);
        dldlRightTop1(resultMap);

        Map<String, Object> resultMap2 = new HashMap<>();
        ywjxOneLeftTop1(resultMap2);
        ywjxOneLeftTop2(resultMap2);
        ywjxOneRightTop1(resultMap2);
        ywjxOneRightTop2(resultMap2);

        Map<String, Object> resultMap3 = new HashMap<>();
        ywjxTwoLeftTop1(resultMap3);
        ywjxTwoLeftTop2(resultMap3);
        ywjxTwoRightTop1(resultMap3);
        ywjxTwoRightTop2(resultMap3);

        Map<String, Object> resultMap4 = getStringObjectMapp2_3();

        res.put("intro", intro);
        //首屏
        res.put("p0", p0);
        //电力电量 P1+P1_2
        res.put("p1", p1);
        res.put("p1_2", resultMap);
        //运维检修 第二屏
        res.put("p2_1", resultMap3);
        res.put("p2_2", resultMap2);
        //运维检修 第一屏
        res.put("p2_3", resultMap4);
        res.put("p2_4", resultMap5);
        res.put("p3_1", p3_1);
        res.put("p3_2", p3_2);
        res.put("p4", p4);
        res.put("p6_1", p6_1);
        res.put("p6_2", p6_2);
        res.put("p6_3", p6_3);
        map.put("data", res);
        map.put("code", 200);
        return map;
    }

    private Map<String, Object> getStringObjectMapp2_4() {
        Map<String, Object> map = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        List<Map<String, Object>> left_top_2 = new ArrayList<>();

        //负载区间
        String sql = "SELECT * FROM szqdzxindex.idn_plrate_rank_stat WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.idn_plrate_rank_stat) AND SHORT_NAME = '大连'";
        Map<String, Object> qshydltMap = dldpResultService.queryInfoBySql2(sql);

        Map<String, Object> tenKvMap = new LinkedHashMap<>();
        tenKvMap.put("label", "10千伏及以下公变数在线");
        tenKvMap.put("value", qshydltMap.get("TOTAL_PTG_NUM"));
        tenKvMap.put("unit", "台");
        left_top_1.add(tenKvMap);
        Map<String, Object> zeroTwentyMap = new LinkedHashMap<>();
        zeroTwentyMap.put("label", "负载区间在0-20%内");
        zeroTwentyMap.put("value", qshydltMap.get("R1_PTG_NUM"));
        zeroTwentyMap.put("unit", "台");
        zeroTwentyMap.put("label1", "占比");
        zeroTwentyMap.put("value1", qshydltMap.get("R1_PR_RATE"));
        zeroTwentyMap.put("unit1", "%");
        zeroTwentyMap.put("label2", "环比");
        zeroTwentyMap.put("value2", qshydltMap.get("R1_LR_RATE"));
        zeroTwentyMap.put("unit2", "%");
        left_top_1.add(zeroTwentyMap);
        Map<String, Object> eightyHunMap = new LinkedHashMap<>();
        eightyHunMap.put("label", "负载区间在80-100%内");
        eightyHunMap.put("value", qshydltMap.get("R4_PTG_NUM"));
        eightyHunMap.put("unit", "台");
        eightyHunMap.put("label1", "占比");
        eightyHunMap.put("value1", qshydltMap.get("R4_PR_RATE"));
        eightyHunMap.put("unit1", "%");
        eightyHunMap.put("label2", "环比");
        eightyHunMap.put("value2", qshydltMap.get("R4_LR_RATE"));
        eightyHunMap.put("unit2", "%");
        left_top_1.add(eightyHunMap);

        // 四个图表
        String chartsql = "SELECT * FROM szqdzxindex.idn_plrate_rank_stat WHERE " +
                "STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.idn_plrate_rank_stat) AND SHORT_NAME != '大连'";
        List<Map<String, Object>> chartResult = dldpResultService.queryInfoBySql(chartsql);

        //0~20
        List<List<Map<String, Object>>> fuzaiData1 = new ArrayList<>();
        Map<String, Object> fuzaichart1 = new LinkedHashMap<>();
        fuzaichart1.put("title", "负载区间在0-20%内");
        fuzaichart1.put("legend", new String[]{"公变", "占比", "环比"});
        List<Map<String, Object>> fuzaichart1List1 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart1List2 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart1List3 = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : chartResult) {
            Map<String, Object> chart1Map1 = new LinkedHashMap<>();
            Map<String, Object> chart1Map2 = new LinkedHashMap<>();
            Map<String, Object> chart1Map3 = new LinkedHashMap<>();
            chart1Map1.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map1.put("value", stringObjectMap.get("R1_PTG_NUM"));
            chart1Map1.put("unit", "台");
            chart1Map2.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map2.put("value", stringObjectMap.get("R1_PR_RATE"));
            chart1Map2.put("unit", "%");
            chart1Map3.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map3.put("value", stringObjectMap.get("R1_LR_RATE"));
            chart1Map3.put("unit", "%");
            fuzaichart1List1.add(chart1Map1);
            fuzaichart1List2.add(chart1Map2);
            fuzaichart1List3.add(chart1Map3);
        }
        fuzaiData1.add(fuzaichart1List1);
        fuzaiData1.add(fuzaichart1List2);
        fuzaiData1.add(fuzaichart1List3);
        fuzaichart1.put("data", fuzaiData1);
        left_top_2.add(fuzaichart1);

        //20~50
        List<List<Map<String, Object>>> fuzaiData2 = new ArrayList<>();
        Map<String, Object> fuzaichart2 = new LinkedHashMap<>();
        fuzaichart2.put("title", "负载区间在20-50%内");
        fuzaichart2.put("legend", new String[]{"公变", "占比", "环比"});
        List<Map<String, Object>> fuzaichart2List1 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart2List2 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart2List3 = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : chartResult) {
            Map<String, Object> chart1Map1 = new LinkedHashMap<>();
            Map<String, Object> chart1Map2 = new LinkedHashMap<>();
            Map<String, Object> chart1Map3 = new LinkedHashMap<>();
            chart1Map1.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map1.put("value", stringObjectMap.get("R2_PTG_NUM"));
            chart1Map1.put("unit", "台");
            chart1Map2.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map2.put("value", stringObjectMap.get("R2_PR_RATE"));
            chart1Map2.put("unit", "%");
            chart1Map3.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map3.put("value", stringObjectMap.get("R2_LR_RATE"));
            chart1Map3.put("unit", "%");
            fuzaichart2List1.add(chart1Map1);
            fuzaichart2List2.add(chart1Map2);
            fuzaichart2List3.add(chart1Map3);
        }
        fuzaiData2.add(fuzaichart2List1);
        fuzaiData2.add(fuzaichart2List2);
        fuzaiData2.add(fuzaichart2List3);
        fuzaichart2.put("data", fuzaiData2);
        left_top_2.add(fuzaichart2);

        //50~80
        List<List<Map<String, Object>>> fuzaiData3 = new ArrayList<>();
        Map<String, Object> fuzaichart3 = new LinkedHashMap<>();
        fuzaichart3.put("title", "负载区间在50-80%内");
        fuzaichart3.put("legend", new String[]{"公变", "占比", "环比"});
        List<Map<String, Object>> fuzaichart3List1 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart3List2 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart3List3 = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : chartResult) {
            Map<String, Object> chart1Map1 = new LinkedHashMap<>();
            Map<String, Object> chart1Map2 = new LinkedHashMap<>();
            Map<String, Object> chart1Map3 = new LinkedHashMap<>();
            chart1Map1.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map1.put("value", stringObjectMap.get("R3_PTG_NUM"));
            chart1Map1.put("unit", "台");
            chart1Map2.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map2.put("value", stringObjectMap.get("R3_PR_RATE"));
            chart1Map2.put("unit", "%");
            chart1Map3.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map3.put("value", stringObjectMap.get("R3_LR_RATE"));
            chart1Map3.put("unit", "%");
            fuzaichart3List1.add(chart1Map1);
            fuzaichart3List2.add(chart1Map2);
            fuzaichart3List3.add(chart1Map3);
        }
        fuzaiData3.add(fuzaichart3List1);
        fuzaiData3.add(fuzaichart3List2);
        fuzaiData3.add(fuzaichart3List3);
        fuzaichart3.put("data", fuzaiData3);
        left_top_2.add(fuzaichart3);

        //80~100
        List<List<Map<String, Object>>> fuzaiData4 = new ArrayList<>();
        Map<String, Object> fuzaichart4 = new LinkedHashMap<>();
        fuzaichart4.put("title", "负载区间在80-100%内");
        fuzaichart4.put("legend", new String[]{"公变", "占比", "环比"});
        List<Map<String, Object>> fuzaichart4List1 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart4List2 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart4List3 = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : chartResult) {
            Map<String, Object> chart1Map1 = new LinkedHashMap<>();
            Map<String, Object> chart1Map2 = new LinkedHashMap<>();
            Map<String, Object> chart1Map3 = new LinkedHashMap<>();
            chart1Map1.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map1.put("value", stringObjectMap.get("R4_PTG_NUM"));
            chart1Map1.put("unit", "台");
            chart1Map2.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map2.put("value", stringObjectMap.get("R4_PR_RATE"));
            chart1Map2.put("unit", "%");
            chart1Map3.put("name", stringObjectMap.get("SHORT_NAME"));
            chart1Map3.put("value", stringObjectMap.get("R4_LR_RATE"));
            chart1Map3.put("unit", "%");
            fuzaichart4List1.add(chart1Map1);
            fuzaichart4List2.add(chart1Map2);
            fuzaichart4List3.add(chart1Map3);
        }
        fuzaiData4.add(fuzaichart4List1);
        fuzaiData4.add(fuzaichart4List2);
        fuzaiData4.add(fuzaichart4List3);
        fuzaichart4.put("data", fuzaiData4);
        left_top_2.add(fuzaichart4);

        map.put("left_top_1", left_top_1);
        map.put("left_top_2", left_top_2);
        return map;
    }

    private Map<String, Object> getStringObjectMapp2_3() {
        Map<String, Object> map = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        List<Map<String, Object>> left_top_2 = new ArrayList<>();
        Map<String, Object> right_top_1 = new LinkedHashMap<>();
        Map<String, Object> right_bottom_1 = new LinkedHashMap<>();
        List<Map<String, Object>> right_bottom_2 = new ArrayList<>();

        //综合供电电压合格率
        String zhgddysql = "SELECT LJHGL LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl ORDER BY YEAR DESC,MONTH DESC LIMIT 1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE b.MC = '国网大连供电公司' AND b.LX = '综合'";
        Map<String, Object> zhgddyMap = dldpResultService.queryInfoBySql2(zhgddysql);
        String zhgddyLastql = "SELECT LJHGL LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl GROUP BY YEAR,MONTH ORDER BY YEAR DESC,MONTH DESC LIMIT 1,1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE b.MC = '国网大连供电公司' AND b.LX = '综合'";
        Map<String, Object> zhgddyLastMap = dldpResultService.queryInfoBySql2(zhgddyLastql);
        Double zhgddyValue = Double.valueOf(zhgddyMap.get("LJHGL").toString());
        Double zhgddyLastValue = Double.valueOf(zhgddyLastMap.get("LJHGL").toString());
        Double zhgddyHb = (zhgddyValue - zhgddyLastValue) * 100 / zhgddyLastValue;
        Map<String, Object> zhgddy = new LinkedHashMap();
        zhgddy.put("label", "综合供电电压合格率");
        zhgddy.put("value", zhgddyValue);
        zhgddy.put("unit", "%");
        zhgddy.put("label1", "环比");
        zhgddy.put("value1", zhgddyHb);
        zhgddy.put("unit1", "%");
        left_top_1.add(zhgddy);
        //城网供电电压合格率
        String cwgddysql = "SELECT LJHGL LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl ORDER BY YEAR DESC,MONTH DESC LIMIT 1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE b.MC = '国网大连供电公司' AND b.LX = '城网'";
        Map<String, Object> cwgddyMap = dldpResultService.queryInfoBySql2(cwgddysql);
        String cwgddyLastql = "SELECT LJHGL LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl GROUP BY YEAR,MONTH ORDER BY YEAR DESC,MONTH DESC LIMIT 1,1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE b.MC = '国网大连供电公司' AND b.LX = '城网'";
        Map<String, Object> cwgddyLastMap = dldpResultService.queryInfoBySql2(cwgddyLastql);
        Double cwgddyValue = Double.valueOf(cwgddyMap.get("LJHGL").toString());
        Double cwgddyLastValue = Double.valueOf(cwgddyLastMap.get("LJHGL").toString());
        Double cwgddyHb = (cwgddyValue - cwgddyLastValue) * 100 / cwgddyLastValue;
        Map<String, Object> cwgddy = new LinkedHashMap();
        cwgddy.put("label", "城网供电电压合格率");
        cwgddy.put("value", cwgddyValue);
        cwgddy.put("unit", "%");
        cwgddy.put("label1", "环比");
        cwgddy.put("value1", cwgddyHb);
        cwgddy.put("unit1", "%");
        left_top_1.add(cwgddy);
        //城网供电电压合格率
        String nwgddysql = "SELECT LJHGL LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl ORDER BY YEAR DESC,MONTH DESC LIMIT 1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE b.MC = '国网大连供电公司' AND b.LX = '农网'";
        Map<String, Object> nwgddyMap = dldpResultService.queryInfoBySql2(nwgddysql);
        String nwgddyLastql = "SELECT LJHGL LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl GROUP BY YEAR,MONTH ORDER BY YEAR DESC,MONTH DESC LIMIT 1,1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE b.MC = '国网大连供电公司' AND b.LX = '农网'";
        Map<String, Object> nwgddyLastMap = dldpResultService.queryInfoBySql2(nwgddyLastql);
        Double nwgddyValue = Double.valueOf(nwgddyMap.get("LJHGL").toString());
        Double nwgddyLastValue = Double.valueOf(nwgddyLastMap.get("LJHGL").toString());
        Double nwgddyHb = (nwgddyValue - nwgddyLastValue) * 100 / nwgddyLastValue;

        Map<String, Object> nwgddy = new LinkedHashMap();
        nwgddy.put("label", "农网供电电压合格率");
        nwgddy.put("value", nwgddyValue);
        nwgddy.put("unit", "%");
        nwgddy.put("label1", "环比");
        nwgddy.put("value1", nwgddyHb);
        nwgddy.put("unit1", "%");
        left_top_1.add(nwgddy);

        //各单位供电电压合格率
        String chartsql = "SELECT b.MC MC,b.LX LX,IFNULL(LJHGL,100) LJHGL FROM (SELECT YEAR year,MONTH month FROM szqdzxindex.dws_itg_gddyhgl " +
                "GROUP BY YEAR,MONTH ORDER BY YEAR DESC,MONTH DESC LIMIT 0,1) a " +
                "LEFT JOIN szqdzxindex.dws_itg_gddyhgl b ON a.year = b.YEAR AND a.month = b.month WHERE MC != '国网大连供电公司'";
        List<Map<String, Object>> chartResult = dldpResultService.queryInfoBySql(chartsql);

        List<List<Map<String, Object>>> fuzaiData4 = new ArrayList<>();
        Map<String, Object> fuzaichart4 = new LinkedHashMap<>();
        fuzaichart4.put("title", "各单位供电电压合格率");
        fuzaichart4.put("legend", new String[]{"综合", "农网", "城网"});
        List<Map<String, Object>> fuzaichart4List1 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart4List2 = new ArrayList<>();
        List<Map<String, Object>> fuzaichart4List3 = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : chartResult) {
            Map<String, Object> chart1Map1 = new LinkedHashMap<>();
            Map<String, Object> chart1Map2 = new LinkedHashMap<>();
            Map<String, Object> chart1Map3 = new LinkedHashMap<>();
            String lx = stringObjectMap.get("LX").toString();
            if ("综合".equals(lx)) {
                chart1Map1.put("name", stringObjectMap.get("MC"));
                chart1Map1.put("value", stringObjectMap.get("LJHGL"));
                chart1Map1.put("unit", "%");
                fuzaichart4List1.add(chart1Map1);
            } else if ("农网".equals(lx)) {
                chart1Map2.put("name", stringObjectMap.get("MC"));
                chart1Map2.put("value", stringObjectMap.get("LJHGL"));
                chart1Map2.put("unit", "%");
                fuzaichart4List2.add(chart1Map2);
            } else if ("城网".equals(lx)) {
                chart1Map3.put("name", stringObjectMap.get("MC"));
                chart1Map3.put("value", stringObjectMap.get("LJHGL"));
                chart1Map3.put("unit", "%");
                fuzaichart4List3.add(chart1Map3);
            }
        }
        fuzaiData4.add(fuzaichart4List1);
        fuzaiData4.add(fuzaichart4List2);
        fuzaiData4.add(fuzaichart4List3);
        fuzaichart4.put("data", fuzaiData4);
        left_top_2.add(fuzaichart4);

        //大连消耗停电时户数
        String dlxhtdsql = "SELECT ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx " +
                "WHERE TDSJ > (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ IN ('故障停电','预安排停电')";
        Map<String, Object> dlxhtdMap = dldpResultService.queryInfoBySql2(dlxhtdsql);
        String dlxhtdLastsql = "SELECT ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx " +
                "WHERE TDSJ > (SELECT DATE_SUB(DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_gdkkx) " +
                "AND TDSJ <=  (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ IN ('故障停电','预安排停电')";
        Map<String, Object> dlxhtdLastMap = dldpResultService.queryInfoBySql2(dlxhtdLastsql);
        Double dlxhtd = Double.valueOf(dlxhtdMap.get("SUM").toString());
        Double dlxhtdLast = Double.valueOf(dlxhtdLastMap.get("SUM").toString());
        Double dlxhtdtb = (dlxhtd - dlxhtdLast) * 100 / dlxhtdLast;
        right_top_1.put("label", "大连消耗停电时户数（周）");
        right_top_1.put("value", dlxhtd);
        right_top_1.put("unit", "时户");
        right_top_1.put("label1", "同比");
        right_top_1.put("value1", dlxhtdtb);
        right_top_1.put("unit1", "%");

        //预安排停电、故障停电图表right_bottom_1
        String tdchartsql = "SELECT SSQX,TDXZ,ROUND(SUM(SHS),0) SUM FROM szqdzxindex.dws_itg_gdkkx WHERE TDSJ > (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY) " +
                "FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ IN ('故障停电','预安排停电') GROUP BY SSQX,TDXZ";
        List<Map<String, Object>> tdchartResult = dldpResultService.queryInfoBySql(tdchartsql);
        String tdzschartsql = "SELECT SSQX,ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx WHERE TDSJ > (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY)" +
                " FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ IN ('故障停电','预安排停电') GROUP BY SSQX";
        List<Map<String, Object>> tdzschartResult = dldpResultService.queryInfoBySql(tdzschartsql);

        List<List<Map<String, Object>>> tdData = new ArrayList<>();
        right_bottom_1.put("legend", new String[]{"预安排停电", "故障停电"});
        List<Map<String, Object>> tdchartList1 = new ArrayList<>();
        List<Map<String, Object>> tdchartList2 = new ArrayList<>();
        List<Map<String, Object>> tdchartList3 = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : tdchartResult) {
            Map<String, Object> chart1Map1 = new LinkedHashMap<>();
            Map<String, Object> chart1Map2 = new LinkedHashMap<>();
            String lx = stringObjectMap.get("TDXZ").toString();
            if ("预安排停电".equals(lx)) {
                chart1Map1.put("name", stringObjectMap.get("SSQX"));
                chart1Map1.put("value", stringObjectMap.get("SUM"));
                chart1Map1.put("unit", "时户");
                tdchartList1.add(chart1Map1);
            } else if ("故障停电".equals(lx)) {
                chart1Map2.put("name", stringObjectMap.get("SSQX"));
                chart1Map2.put("value", stringObjectMap.get("SUM"));
                chart1Map2.put("unit", "时户");
                tdchartList2.add(chart1Map2);
            }
        }
        for (Map<String, Object> stringObjectMap : tdzschartResult) {
            Map<String, Object> chart1Map = new LinkedHashMap<>();
            chart1Map.put("name", stringObjectMap.get("SSQX"));
            chart1Map.put("value", 0);
            chart1Map.put("unit", "时户");
            chart1Map.put("total", stringObjectMap.get("SUM"));
            tdchartList3.add(chart1Map);
        }
        tdData.add(tdchartList1);
        tdData.add(tdchartList2);
        tdData.add(tdchartList3);
        right_bottom_1.put("data", tdData);

        //right_bottom_2
        String ytdshssql = "SELECT ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx " +
                "WHERE TDSJ > (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ = '故障停电'";
        Map<String, Object> ytdshsMap = dldpResultService.queryInfoBySql2(ytdshssql);
        String ytdshsLastsql = "SELECT ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx " +
                "WHERE TDSJ > (SELECT DATE_SUB(DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_gdkkx)" +
                "AND TDSJ <=  (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ = '故障停电'";
        Map<String, Object> ytdshsLastMap = dldpResultService.queryInfoBySql2(ytdshsLastsql);
        Double ytdValue = Double.valueOf(ytdshsMap.get("SUM").toString());
        Double ytdLastValue = Double.valueOf(ytdshsLastMap.get("SUM").toString());
        Double ytdtbValue = (ytdValue - ytdLastValue) * 100 / ytdLastValue;
        Map ytdshs = new LinkedHashMap();
        ytdshs.put("label", "预安排停电\n时户数");
        ytdshs.put("value", ytdValue);
        ytdshs.put("unit", "时户");
        ytdshs.put("label1", "同比");
        ytdshs.put("value1", ytdtbValue);
        ytdshs.put("unit1", "%");
        right_bottom_2.add(ytdshs);

        String gztdshssql = "SELECT ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx " +
                "WHERE TDSJ > (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ = '预安排停电'";
        Map<String, Object> gztdshsMap = dldpResultService.queryInfoBySql2(gztdshssql);
        String gztdshsLastsql = "SELECT ROUND(SUM(SHS),2) SUM FROM szqdzxindex.dws_itg_gdkkx " +
                "WHERE TDSJ > (SELECT DATE_SUB(DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_gdkkx)" +
                "AND TDSJ <=  (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_gdkkx) AND TDXZ = '预安排停电'";
        Map<String, Object> gztdshsLastMap = dldpResultService.queryInfoBySql2(gztdshsLastsql);

        Double gztdValue = Double.valueOf(gztdshsMap.get("SUM").toString());
        Double gztdLastValue = Double.valueOf(gztdshsLastMap.get("SUM").toString());
        Double gztdtbValue = (gztdValue - gztdLastValue) * 100 / gztdLastValue;
        Map gztdshs = new LinkedHashMap();
        gztdshs.put("label", "故障停电\n时户数");
        gztdshs.put("value", gztdValue);
        gztdshs.put("unit", "时户");
        gztdshs.put("label1", "同比");
        gztdshs.put("value1", gztdtbValue);
        gztdshs.put("unit1", "%");
        right_bottom_2.add(gztdshs);

        //设置Y轴最大最小值
        Map<String, Object> left_top_2_chart_option = new LinkedHashMap<>();
        left_top_2_chart_option.put("min",95);
        left_top_2_chart_option.put("max",100);


        map.put("left_top_1", left_top_1);
        map.put("left_top_2", left_top_2);
        map.put("right_top_1", right_top_1);
        map.put("right_bottom_1", right_bottom_1);
        map.put("right_bottom_2", right_bottom_2);
        map.put("left_top_2_chart_option", left_top_2_chart_option);
        return map;
    }

    private Map<String, Object> getStringObjectMapp0() {
        Map<String, Object> resultMap = new LinkedHashMap<>();

        //-------------------------左侧1/3 对应panel_l_1 --------------------------
        Map<String, Object> panel_l_1 = new LinkedHashMap<>();
        Map<String, Object> panel_l_1data = new LinkedHashMap<>();
        //left_top_1_1
        List<Map<String, Object>> left_top_1_1 = new ArrayList<>();
        Map<String, Object> left_top_1_1_One = new LinkedHashMap<>();
        Map<String, Object> left_top_1_1_Two = new LinkedHashMap<>();
        //全社会用电量
        Map<String, Object> qshydltMap = null;
        Double qshydlweek = null;
        Double qshydlweekCircle = null;
        Double qshydlyearCircle = null;
        try {
            String qshydlsql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT MAX(TJRQ) FROM szqdzxindex.dws_itg_qshydl_sy)";
            qshydltMap = dldpResultService.queryInfoBySql2(qshydlsql);
            String qshydl7daysql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_qshydl_sy) ";
            Map<String, Object> qshydl7dayMap = dldpResultService.queryInfoBySql2(qshydl7daysql);
            String qshydl14daysql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 14 DAY) FROM szqdzxindex.dws_itg_qshydl_sy) ";
            Map<String, Object> qshydl14dayMap = dldpResultService.queryInfoBySql2(qshydl14daysql);
            String qshydl1yearsql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_qshydl_sy) ";
            Map<String, Object> qshydl1yearMap = dldpResultService.queryInfoBySql2(qshydl1yearsql);

            qshydlweek = Double.valueOf(qshydltMap.get("NLJ").toString()) - Double.valueOf(qshydl7dayMap.get("NLJ").toString());
            Double qshydlweekLast = Double.valueOf(qshydl7dayMap.get("NLJ").toString()) - Double.valueOf(qshydl14dayMap.get("NLJ").toString());
            qshydlweekCircle = (qshydlweek - qshydlweekLast) / qshydlweekLast;
            qshydlyearCircle = (Double.valueOf(qshydltMap.get("NLJ").toString()) - Double.valueOf(qshydl1yearMap.get("NLJ").toString())) / Double.valueOf(qshydl1yearMap.get("NLJ").toString());

            left_top_1_1_One.put("value", qshydlweek);
            left_top_1_1_One.put("value1", qshydlweekCircle * 100);
            left_top_1_1_Two.put("value", qshydltMap.get("NLJ"));
            left_top_1_1_Two.put("value1", qshydlyearCircle * 100);
        } catch (Exception e) {
            e.printStackTrace();
            left_top_1_1_One.put("value", 0);
            left_top_1_1_One.put("value1", 0);
            left_top_1_1_Two.put("value", 0);
            left_top_1_1_Two.put("value1", 0);
        }

        left_top_1_1_One.put("label", "全社会用电量（周）");
        left_top_1_1_One.put("unit1", "亿");
        left_top_1_1_One.put("unit2", "千瓦时");
        left_top_1_1_One.put("label1", "环比");
        left_top_1_1_One.put("unit", "%");
        left_top_1_1.add(left_top_1_1_One);

        left_top_1_1_Two.put("label", "全社会用电量（年）");
        left_top_1_1_Two.put("unit1", "亿");
        left_top_1_1_Two.put("unit2", "千瓦时");
        left_top_1_1_Two.put("label1", "环比");
        left_top_1_1_Two.put("unit", "%");
        left_top_1_1.add(left_top_1_1_Two);
        panel_l_1data.put("left_top_1_1", left_top_1_1);

        //left_top_1_2
        //15个关注行业用电量,环比
        String gzhyupsql = "SELECT COUNT(*) as COUNT  FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_trade_adpq_week) AND ADPQ_RATE_LW > 0";
        Map<String, Object> gzhyupMap = dldpResultService.queryInfoBySql2(gzhyupsql);
        String gzhydownsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_trade_adpq_week) AND ADPQ_RATE_LW < 0";
        Map<String, Object> gzhydownMap = dldpResultService.queryInfoBySql2(gzhydownsql);

        Map<String, Object> left_top_1_2 = new LinkedHashMap<>();
        left_top_1_2.put("label", "15个关注行业用电量");
        List<Map<String, Object>> left_top_1_2dataList = new ArrayList<>();
        Map<String, Object> left_top_1_2dataOne = new LinkedHashMap<>();
        left_top_1_2dataOne.put("label", "环比");
        left_top_1_2dataOne.put("value", gzhyupMap.get("COUNT"));
        left_top_1_2dataOne.put("unit", "个");
        left_top_1_2dataList.add(left_top_1_2dataOne);
        Map<String, Object> left_top_1_2dataTwo = new LinkedHashMap<>();
        left_top_1_2dataTwo.put("label", "环比");
        left_top_1_2dataTwo.put("value", 0 - Integer.valueOf(gzhydownMap.get("COUNT").toString()));
        left_top_1_2dataTwo.put("unit", "个");
        left_top_1_2dataList.add(left_top_1_2dataTwo);
        left_top_1_2.put("data", left_top_1_2dataList);
        panel_l_1data.put("left_top_1_2", left_top_1_2);

        //left_top_1_3
        //15个关注行业用电量,涨跌幅最大
        String gzhymaxsql = "SELECT TRADE_CODE as TRADECODE, ADPQ_RATE_LW as RATE FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_trade_adpq_week ) AND ADPQ_RATE_LW > 0 ORDER BY ADPQ_RATE_LW DESC LIMIT 1";
        Map<String, Object> gzhymaxMap = dldpResultService.queryInfoBySql2(gzhymaxsql);
        String gzhyminsql = "SELECT TRADE_CODE as TRADECODE, ADPQ_RATE_LW as RATE FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_trade_adpq_week ) AND ADPQ_RATE_LW < 0 ORDER BY ADPQ_RATE_LW LIMIT 1";
        Map<String, Object> gzhyminMap = dldpResultService.queryInfoBySql2(gzhyminsql);

        List<Map<String, Object>> left_top_1_3 = new ArrayList<>();
        Map<String, Object> left_top_1_3One = new LinkedHashMap<>();
        left_top_1_3One.put("label", "涨幅最大");
        left_top_1_3One.put("value", gzhymaxMap.get("TRADECODE"));
        left_top_1_3One.put("value1", gzhymaxMap.get("RATE"));
        left_top_1_3One.put("unit", "%");
        left_top_1_3.add(left_top_1_3One);
        Map<String, Object> left_top_1_3Two = new LinkedHashMap<>();
        left_top_1_3Two.put("label", "跌幅最大");
        left_top_1_3Two.put("value", gzhyminMap.get("TRADECODE"));
        left_top_1_3Two.put("value1", gzhyminMap.get("RATE"));
        left_top_1_3Two.put("unit", "%");
        left_top_1_3.add(left_top_1_3Two);
        panel_l_1data.put("left_top_1_3", left_top_1_3);
        panel_l_1.put("data", panel_l_1data);

        //-------------------------左侧2/3 对应panel_l_2 --------------------------
        Map<String, Object> panel_l_2 = new LinkedHashMap<>();
        Map<String, Object> panel_l_2data = new LinkedHashMap<>();
        //left_1
        String zxxczysql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xczy WHERE zyrq <= (SELECT MAX(zyrq) FROM szqdzxindex.dws_itg_xczy) " +
                "and zyrq > (SELECT DATE_SUB(MAX(zyrq),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xczy)";
        Map<String, Object> zxxczyMap = dldpResultService.queryInfoBySql2(zxxczysql);

        String ddpsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xczy WHERE zyrq <= (SELECT MAX(zyrq) FROM szqdzxindex.dws_itg_xczy) " +
                "and zyrq > (SELECT DATE_SUB(MAX(zyrq),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xczy) AND gzp = '带电票'\n";
        Map<String, Object> ddpMap = dldpResultService.queryInfoBySql2(ddpsql);

        String dcwzsql = "SELECT COUNT(DISTINCT work_plan_id) as COUNT FROM szqdzxindex.dws_itg_peccancy_manage_week " +
                "WHERE begin_time <= (SELECT MAX(begin_time) FROM szqdzxindex.dws_itg_peccancy_manage_week) " +
                "AND begin_time > (SELECT DATE_SUB(MAX(begin_time),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_peccancy_manage_week)\n";
        Map<String, Object> dcwzMap = dldpResultService.queryInfoBySql2(dcwzsql);

        String xltdsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xltd WHERE gzlx in ('接地故障','重合良好','重合不良') " +
                "and sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xltd) and sjsj <= (SELECT MAX(sjsj) FROM szqdzxindex.dws_itg_xltd)";
        Map<String, Object> xltdMap = dldpResultService.queryInfoBySql2(xltdsql);

        String qxgdsql = "SELECT HJ_NUM as HJNUM FROM szqdzxindex.dws_itg_idn_fault_stat_week WHERE " +
                "STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_stat_week) and SHORT_NAME = '大连'";
        Map<String, Object> qxgdMap = dldpResultService.queryInfoBySql2(qxgdsql);

        String pjddxcscsql = "SELECT AVG_ARV_MITS as MITS FROM szqdzxindex.dws_itg_idn_fault_times " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_times) and SHORT_NAME = '大连'";
        Map<String, Object> pjddxcscMap = dldpResultService.queryInfoBySql2(pjddxcscsql);

        List<Map<String, Object>> left_1List = new ArrayList<>();
        Map<String, Object> left_1One = new LinkedHashMap<>();
        left_1One.put("label", "执行现场作业（周）");
        left_1One.put("value", zxxczyMap.get("COUNT"));
        left_1One.put("unit", "件");
        left_1One.put("flag", false);
        left_1List.add(left_1One);
        Map<String, Object> left_1Two = new LinkedHashMap<>();
        left_1Two.put("label", "带电作业（周）");
        left_1Two.put("value", ddpMap.get("COUNT"));
        left_1Two.put("unit", "件");
        left_1Two.put("flag", false);
        left_1List.add(left_1Two);
        Map<String, Object> left_1Three = new LinkedHashMap<>();
        left_1Three.put("label", "督查违章 (周)");
        left_1Three.put("value", dcwzMap.get("COUNT"));
        left_1Three.put("unit", "件");
        left_1Three.put("flag", true);
        left_1List.add(left_1Three);
        Map<String, Object> left_1Four = new LinkedHashMap<>();
        left_1Four.put("label", "10千伏线路停电（周）");
        left_1Four.put("value", xltdMap.get("COUNT"));
        left_1Four.put("unit", "条次");
        left_1Four.put("flag", true);
        left_1List.add(left_1Four);
        Map<String, Object> left_1Five = new LinkedHashMap<>();
        left_1Five.put("label", "95598抢修工单（周）");
        left_1Five.put("value", qxgdMap.get("HJNUM"));
        left_1Five.put("unit", "件");
        left_1Five.put("flag", false);
        left_1List.add(left_1Five);
        Map<String, Object> left_1Six = new LinkedHashMap<>();
        left_1Six.put("label", "平均到达现场时长");
        left_1Six.put("value", pjddxcscMap.get("MITS"));
        left_1Six.put("unit", "分钟");
        left_1Six.put("flag", false);
        left_1List.add(left_1Six);
        panel_l_2data.put("left_1", left_1List);
        //right_1
        String grade3sql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xczy WHERE zyrq <= (SELECT MAX(zyrq) FROM szqdzxindex.dws_itg_xczy) " +
                "and zyrq > (SELECT DATE_SUB(MAX(zyrq),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xczy) AND fxdj IN ('一级','二级','三级')\n";
        Map<String, Object> grade3Map = dldpResultService.queryInfoBySql2(grade3sql);

        String cftdgdsql = "SELECT COUNT(*) as COUNT FROM (SELECT COUNT(*) as num FROM szqdzxindex.dws_itg_tdyj " +
                "WHERE sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_tdyj) GROUP BY tdxlmc) a WHERE a.num > 1 ";
        Map<String, Object> cftdgdMap = dldpResultService.queryInfoBySql2(cftdgdsql);

        List<Map<String, Object>> right_1List = new ArrayList<>();
        Map<String, Object> right_1One = new LinkedHashMap<>();
        right_1One.put("label", "三级及以上作业风险（周）");
        right_1One.put("value", grade3Map.get("COUNT"));
        right_1One.put("unit", "项次");
        right_1One.put("flag", false);
        right_1List.add(right_1One);
        Map<String, Object> right_1Two = new LinkedHashMap<>();
        right_1Two.put("label", "重复停电预警工单 (周)");
        right_1Two.put("value", cftdgdMap.get("COUNT"));
        right_1Two.put("unit", "张");
        right_1Two.put("flag", true);
        right_1List.add(right_1Two);
        panel_l_2data.put("right_1", right_1List);
        //right_2
        String gddyhgsql = "SELECT * FROM szqdzxindex.dws_itg_gddyhgl WHERE LX='综合' and MC = '国网大连供电公司' " +
                "ORDER BY YEAR DESC,MONTH DESC LIMIT 1";
        Map<String, Object> gddyhgMap = dldpResultService.queryInfoBySql2(gddyhgsql);
        String tdshssql = "SELECT SUM(SHS) as SHS FROM szqdzxindex.dws_itg_gdkkx WHERE TDSJ > (SELECT DATE_SUB(MAX(TDSJ),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_gdkkx) " +
                "AND TDXZ IN ('故障停电','预安排停电')";
        Map<String, Object> tdshsMap = dldpResultService.queryInfoBySql2(tdshssql);

        List<Map<String, Object>> right_2List = new ArrayList<>();
        Map<String, Object> right_2One = new LinkedHashMap<>();
        right_2One.put("label", "供电电压合格");
        right_2One.put("value", gddyhgMap.get("LJHGL"));
        right_2One.put("unit", "%");
        right_2One.put("flag", false);
        right_2List.add(right_2One);
        Map<String, Object> right_2Two = new LinkedHashMap<>();
        right_2Two.put("label", "消耗停电时户");
        right_2Two.put("value", new BigDecimal(tdshsMap.get("SHS").toString()).setScale(2, BigDecimal.ROUND_HALF_UP));
        right_2Two.put("unit", "时户");
        right_2Two.put("flag", false);
        right_2List.add(right_2Two);
        panel_l_2data.put("right_2", right_2List);
        //right_3
        String qxpjxfsql = "SELECT AVG_RECO_MITS as MITS FROM szqdzxindex.dws_itg_idn_fault_times " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_times) and SHORT_NAME = '大连'";
        Map<String, Object> qxpjxfMap = dldpResultService.queryInfoBySql2(qxpjxfsql);

        List<Map<String, Object>> right_3List = new ArrayList<>();
        Map<String, Object> right_3One = new LinkedHashMap<>();
        right_3One.put("label", "抢修平均修复时长");
        right_3One.put("value", qxpjxfMap.get("MITS"));
        right_3One.put("unit", "分钟");
        right_3One.put("flag", false);
        right_3List.add(right_3One);
        panel_l_2data.put("right_3", right_3List);
        panel_l_2.put("data", panel_l_2data);
        //-------------------------左侧3/3 对应panel_l_3 --------------------------
        Map<String, Object> panel_l_3 = new LinkedHashMap<>();
        Map<String, Object> panel_l_3data = new LinkedHashMap<>();

        String xzzrsql = "SELECT COUNT(app_no) as APPNO,SUM(app_run_cap)/10000 as CAP FROM szqdzxindex.dws_itg_idn_bus_app_info_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_info_week) " +
                "AND data_type = '本期申请' AND wk_order_name IN ('低压批量新装','低压非居民新装增容','低压居民新装增容')";
        Map<String, Object> xzzrMap = dldpResultService.queryInfoBySql2(xzzrsql);
        String jrztsql = "SELECT COUNT(app_no) as APPNO,SUM(app_run_cap)/10000 as CAP FROM szqdzxindex.dws_itg_idn_bus_app_info_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_info_week) AND wk_order_name IN ('销户','减容')";
        Map<String, Object> jrztMap = dldpResultService.queryInfoBySql2(jrztsql);
        String yksqsql1 = "SELECT hj as HJ FROM szqdzxindex.dws_itg_idn_bus_app_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_stat_week) AND SHORT_NAME = '大连' AND disp_no = '01'";
        Map<String, Object> yksqMap1 = dldpResultService.queryInfoBySql2(yksqsql1);
        String yksqsql2 = "SELECT hj as HJ FROM szqdzxindex.dws_itg_idn_bus_app_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_stat_week) AND SHORT_NAME = '大连' AND disp_no = '02'";
        Map<String, Object> yksqMap2 = dldpResultService.queryInfoBySql2(yksqsql2);

        //left
        List<Map<String, Object>> leftList = new ArrayList<>();
        Map<String, Object> leftOne = new LinkedHashMap<>();
        leftOne.put("label", "新装增容（周）");
        leftOne.put("value", xzzrMap.get("APPNO"));
        leftOne.put("unit", "件");
        leftOne.put("value1", xzzrMap.get("CAP"));
        leftOne.put("unit1", "万");
        leftOne.put("unit2", "千伏安");
        leftList.add(leftOne);
        Map<String, Object> leftTwo = new LinkedHashMap<>();
        leftTwo.put("label", "减容暂停销户（周）");
        leftTwo.put("value", jrztMap.get("APPNO"));
        leftTwo.put("unit", "件");
        leftTwo.put("value1", jrztMap.get("CAP"));
        leftTwo.put("unit1", "万");
        leftTwo.put("unit2", "千伏安");
        leftList.add(leftTwo);
        Map<String, Object> leftThree = new LinkedHashMap<>();
        leftThree.put("label", "业扩申请项目数（周）");
        leftThree.put("value", yksqMap1.get("HJ"));
        leftThree.put("unit", "件");
        leftThree.put("value1", yksqMap2.get("HJ"));
        leftThree.put("unit1", "万");
        leftThree.put("unit2", "千伏安");
        leftList.add(leftThree);
        panel_l_3data.put("left", leftList);
        //right
        List<Map<String, Object>> rightList = new ArrayList<>();
        Map<String, Object> rightOne = new LinkedHashMap<>();

        String tsgdsql1 = "SELECT order_num as NUM FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week " +
                "WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) AND short_name = '大连' AND bus_type = '002'";
        Map<String, Object> tsgdMap1 = dldpResultService.queryInfoBySql2(tsgdsql1);

        String tsgdsql2 = "SELECT order_num as NUM FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week " +
                "WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) AND short_name = '大连' AND bus_type = '001'";
        Map<String, Object> tsgdMap2 = dldpResultService.queryInfoBySql2(tsgdsql2);


        rightOne.put("label", "95598投诉工单（周）");
        rightOne.put("value", tsgdMap1 == null ? "0" : tsgdMap1.get("NUM"));
        rightOne.put("unit", "件");
        rightOne.put("flag", true);
        rightList.add(rightOne);
        Map<String, Object> rightTwo = new LinkedHashMap<>();
        rightTwo.put("label", "95598意见工单（周）");
        rightTwo.put("value", tsgdMap2 == null ? "0" : tsgdMap2.get("NUM"));
        rightTwo.put("unit", "件");
        rightTwo.put("flag", false);
        rightList.add(rightTwo);
        panel_l_3data.put("right", rightList);
        panel_l_3.put("data", panel_l_3data);


        //-------------------------右侧1/3 对应panel_r_1 --------------------------
        Map<String, Object> panel_r_1 = new LinkedHashMap<>();
        Map<String, Object> panel_r_1data = new LinkedHashMap<>();

        String tqxsdblsql = "SELECT AVG(QUALIF_RATE) AVG1,AVG(QUALIF_RATE_LW) AVG2 FROM szqdzxindex.dws_itg_idn_tgll_stat_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week)";
        Map<String, Object> tqxsdblMap = dldpResultService.queryInfoBySql2(tqxsdblsql);
        Double tqxsdbl = Double.valueOf(tqxsdblMap.get("AVG1").toString());
        Double tqxsdblsq = Double.valueOf(tqxsdblMap.get("AVG2").toString());
        Double tqxsdblCircle = (tqxsdbl - tqxsdblsq) * 100 / tqxsdblsq;

        String fstqsql = "SELECT SUM(NEGLL_TG_NUM) SUM1,SUM(NEGLL_TG_NUM_LW) SUM2 FROM szqdzxindex.dws_itg_idn_tgll_stat_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week)";
        Map<String, Object> fstqMap = dldpResultService.queryInfoBySql2(fstqsql);
        Double fstq = Double.valueOf(fstqMap.get("SUM1").toString());
        Double fstqlw = Double.valueOf(fstqMap.get("SUM2").toString());
        Double fstqCircle = (fstq - fstqlw) * 100 / fstqlw;

        String gstqsql = "SELECT SUM(HIGHLL_TG_NUM) SUM1,SUM(HIGHLL_TG_NUM_LW) SUM2 FROM szqdzxindex.dws_itg_idn_tgll_stat_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week)";
        Map<String, Object> gstqMap = dldpResultService.queryInfoBySql2(gstqsql);
        Double gstq = Double.valueOf(gstqMap.get("SUM1").toString());
        Double gstqlw = Double.valueOf(gstqMap.get("SUM2").toString());
        Double gstqCircle = (gstq - gstqlw) * 100 / gstqlw;

        //left
        List<Map<String, Object>> panel_r_1leftList = new ArrayList<>();
        Map<String, Object> panel_r_1leftOne = new LinkedHashMap<>();
        panel_r_1leftOne.put("label", "台区线损达标率");
        panel_r_1leftOne.put("value", tqxsdbl);
        panel_r_1leftOne.put("unit", "%");
        panel_r_1leftOne.put("label1", "环比");
        panel_r_1leftOne.put("value1", tqxsdblCircle);
        panel_r_1leftOne.put("unit1", "%");
        panel_r_1leftList.add(panel_r_1leftOne);
        Map<String, Object> panel_r_1leftTwo = new LinkedHashMap<>();
        panel_r_1leftTwo.put("label", "负损台区（周）");
        panel_r_1leftTwo.put("value", fstq);
        panel_r_1leftTwo.put("unit", "个");
        panel_r_1leftTwo.put("label1", "环比");
        panel_r_1leftTwo.put("value1", fstqCircle);
        panel_r_1leftTwo.put("unit1", "%");
        panel_r_1leftList.add(panel_r_1leftTwo);
        Map<String, Object> panel_r_1leftThree = new LinkedHashMap<>();
        panel_r_1leftThree.put("label", "高损台区（周）");
        panel_r_1leftThree.put("value", gstq);
        panel_r_1leftThree.put("unit", "个");
        panel_r_1leftThree.put("label1", "环比");
        panel_r_1leftThree.put("value1", gstqCircle);
        panel_r_1leftThree.put("unit1", "%");
        panel_r_1leftList.add(panel_r_1leftThree);
        panel_r_1data.put("left", panel_r_1leftList);
        //right

        String tqxslsql = "SELECT AVG(LL_RATE) AVG1,AVG(LL_RATE_LW) AVG2 FROM szqdzxindex.dws_itg_idn_tgll_stat_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week)";
        Map<String, Object> tqxslMap = dldpResultService.queryInfoBySql2(tqxslsql);
        Double tqxsl = Double.valueOf(tqxslMap.get("AVG1").toString()) * 100;
        Double tqxslsq = Double.valueOf(tqxslMap.get("AVG2").toString()) * 100;
        Double tqxslCircle = (tqxsl - tqxslsq) / tqxslsq;

        List<Map<String, Object>> panel_r_1rightList = new ArrayList<>();
        Map<String, Object> panel_r_1rihtOne = new LinkedHashMap<>();
        panel_r_1rihtOne.put("label", "台区线损率");
        panel_r_1rihtOne.put("value", tqxsl);
        panel_r_1rihtOne.put("unit", "%");
        panel_r_1rihtOne.put("label1", "环比");
        panel_r_1rihtOne.put("value1", tqxslCircle);
        panel_r_1rihtOne.put("unit1", "%");
        panel_r_1rightList.add(panel_r_1rihtOne);
        panel_r_1data.put("right", panel_r_1rightList);
        panel_r_1.put("data", panel_r_1data);

        //-------------------------右侧2/3 对应panel_r_2 --------------------------
        Map<String, Object> panel_r_2 = new LinkedHashMap<>();

        String zjpnwgcsql = "SELECT COUNT(DISTINCT project_name) COUNT FROM szqdzxindex.prod_engr_detail " +
                "WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.prod_engr_detail)";
        Map<String, Object> zjpnwgcMap = dldpResultService.queryInfoBySql2(zjpnwgcsql);

        String zjpnwgcyqsql = "SELECT COUNT(DISTINCT project_name) COUNT FROM szqdzxindex.prod_engr_detail " +
                "WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.prod_engr_detail) AND overdue = '已逾'";
        Map<String, Object> zjpnwgcyqMap = dldpResultService.queryInfoBySql2(zjpnwgcyqsql);

        String ykptxmsql = "SELECT COUNT(*) COUNT FROM szqdzxindex.bus_new_project WHERE UPDATE_TIME > (SELECT DATE_SUB(MAX(UPDATE_TIME),INTERVAL 7 DAY) FROM szqdzxindex.bus_new_project)";
        Map<String, Object> ykptxmMap = dldpResultService.queryInfoBySql2(ykptxmsql);

        String xmdqhjcqsql = "SELECT count(*) COUNT FROM (SELECT * FROM szqdzxindex.bus_new_project WHERE STATUS = 2) a " +
                "LEFT JOIN szqdzxindex.bus_new_detail b on a.ID = b.PROJECT_ID WHERE b.OVERDUE = 'true'";
        Map<String, Object> xmdqhjcqMap = dldpResultService.queryInfoBySql2(xmdqhjcqsql);

        String scjggcsql = "SELECT count(*) COUNT FROM szqdzxindex.prod_engr_detail WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.prod_engr_detail) AND engr_category = '生产技改'";
        Map<String, Object> scjggcMap = dldpResultService.queryInfoBySql2(scjggcsql);

        String scjggcyqsql = "SELECT count(*) COUNT FROM szqdzxindex.prod_engr_detail WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.prod_engr_detail) " +
                "AND engr_category = '生产技改' AND overdue = '已逾'";
        Map<String, Object> scjggcyqMap = dldpResultService.queryInfoBySql2(scjggcyqsql);

        String scdxgcsql = "SELECT count(*) COUNT FROM szqdzxindex.prod_engr_detail WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.prod_engr_detail) AND engr_category = '生产大修'";
        Map<String, Object> scdxgcMap = dldpResultService.queryInfoBySql2(scdxgcsql);

        String scdxgcyqsql = "SELECT count(*) COUNT FROM szqdzxindex.prod_engr_detail WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.prod_engr_detail) " +
                "AND engr_category = '生产大修' AND overdue = '已逾'";
        Map<String, Object> scdxgcyqMap = dldpResultService.queryInfoBySql2(scdxgcyqsql);


        String dyslgcsql = "SELECT dt_project_anount AMOUNT,gd GD FROM szqdzxindex.three_zero_project_low_tension " +
                "WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.three_zero_project_low_tension)";
        Map<String, Object> dyslgcMap = dldpResultService.queryInfoBySql2(dyslgcsql);

        String jjxjgcsql = "SELECT xujian_gc XUJIAN,xinjian_gc XINJIAN FROM szqdzxindex.intra_project WHERE update_time = (SELECT MAX(update_time) FROM szqdzxindex.intra_project)";
        Map<String, Object> jjxjgcMap = dldpResultService.queryInfoBySql2(jjxjgcsql);

        List<Map<String, Object>> panel_r_2List = new ArrayList<>();
        Map<String, Object> panel_r_2List_One = new LinkedHashMap<>();
        panel_r_2List_One.put("label", "在建配农网工程");
        panel_r_2List_One.put("value", zjpnwgcMap.get("COUNT"));
        panel_r_2List_One.put("unit", "项");
        panel_r_2List_One.put("label1", "存在超期情况的工程");
        panel_r_2List_One.put("value1", zjpnwgcyqMap.get("COUNT"));
        panel_r_2List_One.put("unit1", "项");
        panel_r_2List_One.put("flag", true);
        panel_r_2List.add(panel_r_2List_One);
        Map<String, Object> panel_r_2List_Two = new LinkedHashMap<>();
        panel_r_2List_Two.put("label", "10kV业扩配套项目");
        panel_r_2List_Two.put("value", ykptxmMap.get("COUNT"));
        panel_r_2List_Two.put("unit", "项");
        panel_r_2List_Two.put("label1", "项目当前环节超期");
        panel_r_2List_Two.put("value1", xmdqhjcqMap.get("COUNT"));
        panel_r_2List_Two.put("unit1", "项");
        panel_r_2List_Two.put("flag", true);
        panel_r_2List.add(panel_r_2List_Two);
        Map<String, Object> panel_r_2List_Three = new LinkedHashMap<>();
        panel_r_2List_Three.put("label", "生产技改工程");
        panel_r_2List_Three.put("value", scjggcMap.get("COUNT"));
        panel_r_2List_Three.put("unit", "项");
        panel_r_2List_Three.put("label1", "存在超期情况的工程");
        panel_r_2List_Three.put("value1", scjggcyqMap.get("COUNT"));
        panel_r_2List_Three.put("unit1", "项");
        panel_r_2List_Three.put("flag", true);
        panel_r_2List.add(panel_r_2List_Three);
        Map<String, Object> panel_r_2List_Four = new LinkedHashMap<>();
        panel_r_2List_Four.put("label", "生产大修工程");
        panel_r_2List_Four.put("value", scdxgcMap.get("COUNT"));
        panel_r_2List_Four.put("unit", "项");
        panel_r_2List_Four.put("label1", "存在超期情况的工程");
        panel_r_2List_Four.put("value1", scdxgcyqMap.get("COUNT"));
        panel_r_2List_Four.put("unit1", "项");
        panel_r_2List_Four.put("flag", true);
        panel_r_2List.add(panel_r_2List_Four);
        Map<String, Object> panel_r_2List_Five = new LinkedHashMap<>();
        panel_r_2List_Five.put("label", "低压“三零”工程");
        panel_r_2List_Five.put("value", dyslgcMap.get("AMOUNT"));
        panel_r_2List_Five.put("unit", "项");
        panel_r_2List_Five.put("label1", "已完成决算归档工程");
        panel_r_2List_Five.put("value1", dyslgcMap.get("GD"));
        panel_r_2List_Five.put("unit1", "项");
        panel_r_2List_Five.put("flag", true);
        panel_r_2List.add(panel_r_2List_Five);
        Map<String, Object> panel_r_2List_Six = new LinkedHashMap<>();
        panel_r_2List_Six.put("label", "基建续建工程");
        panel_r_2List_Six.put("value", jjxjgcMap.get("XUJIAN"));
        panel_r_2List_Six.put("unit", "项");
        panel_r_2List_Six.put("label1", "基建新建工程");
        panel_r_2List_Six.put("value1", jjxjgcMap.get("XINJIAN"));
        panel_r_2List_Six.put("unit1", "项");
        panel_r_2List_Six.put("flag", true);
        panel_r_2List.add(panel_r_2List_Six);
        panel_r_2.put("data", panel_r_2List);

        //-------------------------右侧3/3 对应panel_r_3 --------------------------
        Map<String, Object> panel_r_3 = new LinkedHashMap<>();
        Map<String, Object> panel_r_3data = new LinkedHashMap<>();
        //left
        String kcwzjesql = "SELECT SUM(story_amt)/10000 SUM FROM szqdzxindex.dws_itg_idn_story_amt_stat_week " +
                "WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_story_amt_stat_week)";
        Map<String, Object> kcwzjeMap = dldpResultService.queryInfoBySql2(kcwzjesql);

        String kcwzxmsql = "SELECT SUM(story_amt)/10000 SUM FROM szqdzxindex.dws_itg_idn_story_amt_stat_week " +
                "WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_story_amt_stat_week) AND story_sort = '项目类'";
        Map<String, Object> kcwzxmMap = dldpResultService.queryInfoBySql2(kcwzxmsql);

        String kcwzfxmsql = "SELECT SUM(story_amt)/10000 SUM FROM szqdzxindex.dws_itg_idn_story_amt_stat_week " +
                "WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_story_amt_stat_week) AND story_sort = '非项目类'";
        Map<String, Object> kcwzfxmMap = dldpResultService.queryInfoBySql2(kcwzfxmsql);

        List<Map<String, Object>> panel_r_3LeftList = new ArrayList<>();
        Map<String, Object> panel_r_3List_One = new LinkedHashMap<>();
        panel_r_3List_One.put("label", "库存物资金额");
        panel_r_3List_One.put("value", kcwzjeMap.get("SUM"));
        panel_r_3List_One.put("unit", "万元");
        panel_r_3LeftList.add(panel_r_3List_One);
        Map<String, Object> panel_r_3List_Two = new LinkedHashMap<>();
        panel_r_3List_Two.put("label", "项目库存物资");
        panel_r_3List_Two.put("value", kcwzxmMap.get("SUM"));
        panel_r_3List_Two.put("unit", "万元");
        panel_r_3LeftList.add(panel_r_3List_Two);
        Map<String, Object> panel_r_3List_Three = new LinkedHashMap<>();
        panel_r_3List_Three.put("label", "一般库存物资");
        panel_r_3List_Three.put("value", kcwzfxmMap.get("SUM"));
        panel_r_3List_Three.put("unit", "万元");
        panel_r_3LeftList.add(panel_r_3List_Three);
        panel_r_3data.put("left", panel_r_3LeftList);
        //right

        String qllsql = "SELECT * FROM (SELECT mater_sort NAME,SUM(story_amt)/10000 SUM FROM szqdzxindex.dws_itg_idn_story_amt_stat_week " +
                "WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_story_amt_stat_week) GROUP BY mater_sort) a  ORDER BY a.sum DESC LIMIT 2";
        List<Map<String, Object>> qllsqlmaps = queryInfoBySql(qllsql);

        String qllName0 = qllsqlmaps.get(0).get("NAME").toString();
        Double qllAMOUNT0 = Double.valueOf(qllsqlmaps.get(0).get("SUM").toString());

        String qllName1 = qllsqlmaps.get(1).get("NAME").toString();
        Double qllAMOUNT1 = Double.valueOf(qllsqlmaps.get(1).get("SUM").toString());
        Double wzze = Double.valueOf(kcwzjeMap.get("SUM").toString());

        BigDecimal qllBig0 = new BigDecimal(qllsqlmaps.get(0).get("SUM").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal qllBig1 = new BigDecimal(qllsqlmaps.get(1).get("SUM").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal qllzb0 = new BigDecimal(qllAMOUNT0 * 100 / wzze).setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal qllzb1 = new BigDecimal(qllAMOUNT1 * 100 / wzze).setScale(2, BigDecimal.ROUND_HALF_UP);

        Map<String, Object> panel_r_3right = new LinkedHashMap<>();
        panel_r_3right.put("title", "库存物资金额占比较多前两项");
        List<Map<String, Object>> panel_r_3RightList = new ArrayList<>();
        Map<String, Object> panel_r_3Right_One = new LinkedHashMap<>();
        panel_r_3Right_One.put("label", qllName0);
        panel_r_3Right_One.put("value", qllBig0);
        panel_r_3Right_One.put("unit", "万元");
        panel_r_3Right_One.put("label1", "占比");
        panel_r_3Right_One.put("value1", qllzb0);
        panel_r_3Right_One.put("unit1", "%");
        panel_r_3RightList.add(panel_r_3Right_One);
        Map<String, Object> panel_r_3Right_Two = new LinkedHashMap<>();
        panel_r_3Right_Two.put("label", qllName1);
        panel_r_3Right_Two.put("value", qllBig1);
        panel_r_3Right_Two.put("unit", "万元");
        panel_r_3Right_Two.put("label1", "占比");
        panel_r_3Right_Two.put("value1", qllzb1);
        panel_r_3Right_Two.put("unit1", "%");
        panel_r_3RightList.add(panel_r_3Right_Two);
        panel_r_3right.put("data", panel_r_3RightList);
        panel_r_3data.put("right", panel_r_3right);
        panel_r_3.put("data", panel_r_3data);

        //-------------------------map 1/2 对应mapInfo1 --------------------------
        List<Map<String, Object>> mapInfo1 = new ArrayList<>();

        String sqsj = "select * FROM dldp_spsj where zbqs=(select MAX(zbqs) FROM dldp_spsj) order by xh+0";
        List<Map<String, Object>> sqsjRes = dldpResultService.queryInfoBySql(sqsj);

        Map<String, Object> mapInfo1One = new LinkedHashMap<>();
        mapInfo1One.put("label", sqsjRes.get(0).get("bt"));
        mapInfo1One.put("value", sqsjRes.get(0).get("value"));
        mapInfo1One.put("unit", sqsjRes.get(0).get("unit"));
        mapInfo1One.put("unit1", sqsjRes.get(0).get("uni2"));
        mapInfo1.add(mapInfo1One);
        Map<String, Object> mapInfo1Two = new LinkedHashMap<>();
        mapInfo1Two.put("label", sqsjRes.get(1).get("bt"));
        mapInfo1Two.put("value", sqsjRes.get(1).get("value"));
        mapInfo1Two.put("unit", sqsjRes.get(1).get("unit"));
        mapInfo1Two.put("unit1", sqsjRes.get(1).get("unit2"));
        mapInfo1.add(mapInfo1Two);

        //-------------------------map 2/2 对应mapInfo1 --------------------------
        String qjnyfdsql = "SELECT SUM(fdl_year)/10000 SUM FROM szqdzxindex.dws_itg_qjnyfd " +
                "WHERE create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd) AND elec_name IN (SELECT elec_name FROM szqdzxindex.dwd_itg_dianchang_dl WHERE type != '火')";
        Map<String, Object> qjnyfdMap = dldpResultService.queryInfoBySql2(qjnyfdsql);
        String qjnyfdzbsql = "SELECT SUM(fdl_year)/10000 SUM FROM szqdzxindex.dws_itg_qjnyfd " +
                "WHERE create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd) AND elec_name IN (SELECT elec_name FROM szqdzxindex.dwd_itg_dianchang_dl)";
        Map<String, Object> qjnyfdzbMap = dldpResultService.queryInfoBySql2(qjnyfdzbsql);

        Double qjnyfd = Double.valueOf(qjnyfdMap.get("SUM").toString());
        Double qjnyfdze = Double.valueOf(qjnyfdzbMap.get("SUM").toString());
        Double qjnyfdzb = qjnyfd * 100 / qjnyfdze;

        Map<String, Object> mapInfo2 = new LinkedHashMap<>();
        mapInfo2.put("title", "清洁能源发电情况");
        mapInfo2.put("label", "清洁能源发电量(含核电)");
        mapInfo2.put("value", qjnyfd);
        mapInfo2.put("unit", "亿千瓦时");
        mapInfo2.put("label1", "占比");
        mapInfo2.put("value1", qjnyfdzb);
        mapInfo2.put("unit1", "%");


        resultMap.put("panel_l_1", panel_l_1);
        resultMap.put("panel_l_2", panel_l_2);
        resultMap.put("panel_l_3", panel_l_3);
        resultMap.put("panel_r_1", panel_r_1);
        resultMap.put("panel_r_2", panel_r_2);
        resultMap.put("panel_r_3", panel_r_3);
        resultMap.put("mapInfo1", mapInfo1);
        resultMap.put("mapInfo2", mapInfo2);
        return resultMap;

    }

    private Map<String, Object> getStringObjectMapp1() {
        Map<String, Object> map2 = new LinkedHashMap<>();
        //全社会用电量
        String qshydlsql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT MAX(TJRQ) FROM szqdzxindex.dws_itg_qshydl_sy)";
        Map<String, Object> qshydltMap = dldpResultService.queryInfoBySql2(qshydlsql);
        String qshydl7daysql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_qshydl_sy) ";
        Map<String, Object> qshydl7dayMap = dldpResultService.queryInfoBySql2(qshydl7daysql);
        String qshydl14daysql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 14 DAY) FROM szqdzxindex.dws_itg_qshydl_sy) ";
        Map<String, Object> qshydl14dayMap = dldpResultService.queryInfoBySql2(qshydl14daysql);
        String qshydl1yearsql = "SELECT * FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ = (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 1 YEAR) FROM szqdzxindex.dws_itg_qshydl_sy) ";
        Map<String, Object> qshydl1yearMap = dldpResultService.queryInfoBySql2(qshydl1yearsql);

        Double qshydlweek = Double.valueOf(qshydltMap.get("NLJ").toString()) - Double.valueOf(qshydl7dayMap.get("NLJ").toString());
        Double qshydlweekLast = Double.valueOf(qshydl7dayMap.get("NLJ").toString()) - Double.valueOf(qshydl14dayMap.get("NLJ").toString());
        Double qshydlweekCircle = (qshydlweek - qshydlweekLast) / qshydlweekLast;
        Double qshydlYear = (Double.valueOf(qshydltMap.get("NLJ").toString()) - Double.valueOf(qshydl1yearMap.get("NLJ").toString()));
        Double qshydlyearCircle = qshydlYear / Double.valueOf(qshydl1yearMap.get("NLJ").toString());

        Map<String, Object> qshydlwMap = new LinkedHashMap<>();
        qshydlwMap.put("label", "全社会用电量（周）");
        qshydlwMap.put("value", qshydlweek);
        qshydlwMap.put("unit1", "亿");
        qshydlwMap.put("unit2", "千瓦时");
        Map<String, Object> qshydlwDataMap = new LinkedHashMap<>();
        qshydlwDataMap.put("label", "环比");
        qshydlwDataMap.put("value", qshydlweekCircle * 100);
        qshydlwDataMap.put("unit", "%");
        qshydlwMap.put("data", qshydlwDataMap);

        Map<String, Object> qshydlyMap = new LinkedHashMap<>();
        qshydlyMap.put("label", "全社会用电量（年）");
        qshydlyMap.put("value", qshydltMap.get("NLJ"));
        qshydlyMap.put("unit1", "亿");
        qshydlyMap.put("unit2", "千瓦时");
        Map<String, Object> qshydlyDataMap = new LinkedHashMap<>();
        qshydlyDataMap.put("label", "同比");
        qshydlyDataMap.put("value", qshydlyearCircle * 100);
        qshydlyDataMap.put("unit", "%");
        qshydlyMap.put("data", qshydlyDataMap);


        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        left_top_1.add(qshydlwMap);
        left_top_1.add(qshydlyMap);
        map2.put("left_top_1", left_top_1);
        //大连全社会用电量趋势变化情况
        //全社会用电量（月）SQL
        String qshydlm = "SELECT DATE_FORMAT(aa.MONTH, '%Y%m') MONTH,bb.YLJ YLJ FROM (SELECT LAST_DAY(a.MONTH) MONTH FROM  " +
                "(SELECT DATE_FORMAT(TJRQ, '%Y-%m-01') as MONTH FROM szqdzxindex.dws_itg_qshydl_sy WHERE TJRQ > (SELECT DATE_SUB(MAX(TJRQ),INTERVAL 1 Year) " +
                "FROM szqdzxindex.dws_itg_qshydl_sy) GROUP BY DATE_FORMAT(TJRQ, '%Y-%m-01'))a LIMIT 12 ) aa LEFT JOIN szqdzxindex.dws_itg_qshydl_sy bb ON aa.MONTH = bb.TJRQ";
        List<Map<String, Object>> qshydlmRes = dldpResultService.queryInfoBySql(qshydlm);
        Map<String, Object> left_top_2 = new LinkedHashMap<>();
        left_top_2.put("title", "大连全社会用电量趋势变化情况");
        List<Map<String, Object>> left_top_2data = new ArrayList<>();
        Map<String, Object> mdata = new LinkedHashMap<>();
        List<Map<String, Object>> mdataList = new ArrayList<>();
        for (Map<String, Object> res : qshydlmRes) {
            Map<String, Object> m = new LinkedHashMap<>();
            m.put("name", res.get("MONTH"));
            m.put("value", res.get("YLJ"));
            m.put("unit", "");
            mdataList.add(m);
        }

        mdata.put("label", "月电量统计");
        mdata.put("data", new Object[]{mdataList});
        mdata.put("legend", new String[]{"月电量（亿千瓦时）"});

        left_top_2data.add(mdata);

        left_top_2.put("data", left_top_2data);
        map2.put("left_top_2", left_top_2);


        //15个关注行业用电量环比（涨幅/跌幅）SQL
        //15个关注行业用电量,环比
        String gzhyupsql = "SELECT COUNT(*) as COUNT  FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_trade_adpq_week) AND ADPQ_RATE_LW > 0";
        Map<String, Object> gzhyupMap = dldpResultService.queryInfoBySql2(gzhyupsql);
        String gzhydownsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_trade_adpq_week) AND ADPQ_RATE_LW < 0";
        Map<String, Object> gzhydownMap = dldpResultService.queryInfoBySql2(gzhydownsql);

        //15个关注行业用电量,涨跌幅最大
        String gzhymaxsql = "SELECT TRADE_CODE as TRADECODE, ADPQ_RATE_LW as RATE FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_trade_adpq_week ) AND ADPQ_RATE_LW > 0 ORDER BY ADPQ_RATE_LW DESC LIMIT 1";
        Map<String, Object> gzhymaxMap = dldpResultService.queryInfoBySql2(gzhymaxsql);
        String gzhyminsql = "SELECT TRADE_CODE as TRADECODE, ADPQ_RATE_LW as RATE FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_trade_adpq_week ) AND ADPQ_RATE_LW < 0 ORDER BY ADPQ_RATE_LW LIMIT 1";
        Map<String, Object> gzhyminMap = dldpResultService.queryInfoBySql2(gzhyminsql);

        Map<String, Object> datazfMap = new LinkedHashMap<>();
        Map<String, Object> datadfMap = new LinkedHashMap<>();
        List<Map<String, Object>> hyydHbData = new ArrayList<>();
        datadfMap.put("label", "环比");
        datadfMap.put("value", 0 - Integer.valueOf(gzhydownMap.get("COUNT").toString()));
        datadfMap.put("unit", "个");
        datadfMap.put("label1", "跌幅最大");
        datadfMap.put("name1", gzhyminMap.get("TRADECODE"));
        datadfMap.put("value1", gzhyminMap.get("RATE"));
        datadfMap.put("unit1", "%");

        datazfMap.put("label", "环比");
        datazfMap.put("value", gzhyupMap.get("COUNT"));
        datazfMap.put("unit", "个");
        datazfMap.put("label1", "涨幅最大");
        datazfMap.put("name1", gzhymaxMap.get("TRADECODE"));
        datazfMap.put("value1", gzhymaxMap.get("RATE"));
        datazfMap.put("unit1", "%");

        hyydHbData.add(datazfMap);
        hyydHbData.add(datadfMap);
        Map<String, Object> right_top_1 = new LinkedHashMap<>();
        right_top_1.put("title", "15个关注行业用电量");
        right_top_1.put("data", hyydHbData);
        map2.put("right_top_1", right_top_1);

        //行业用电量情况

        String hyydqk = "SELECT TRADE_CODE TRADECODE,MAX(AD_PQ_LW) as SQ,MAX(AD_PQ) as BQ, MAX(ADPQ_RATE_LW) as HB FROM szqdzxindex.dws_itg_idn_trade_adpq_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_trade_adpq_week) GROUP BY TRADE_CODE";
        List<Map<String, Object>> hyydqkRes = dldpResultService.queryInfoBySql(hyydqk);
        List<List<Map<String, Object>>> hyydqkData = new ArrayList<>();

        List<Map<String, Object>> sqhyydList = new ArrayList<>();
        List<Map<String, Object>> bqhyydList = new ArrayList<>();
        List<Map<String, Object>> hbhyydList = new ArrayList<>();

        for (Map<String, Object> qkres : hyydqkRes) {
            Map<String, Object> sq = new LinkedHashMap<>();
            Map<String, Object> bq = new LinkedHashMap<>();
            Map<String, Object> hb = new LinkedHashMap<>();
            sq.put("name", qkres.get("TRADECODE"));
            bq.put("name", qkres.get("TRADECODE"));
            hb.put("name", qkres.get("TRADECODE"));
            sq.put("value", qkres.get("SQ"));
            bq.put("value", qkres.get("BQ"));
            hb.put("value", qkres.get("HB"));
            sq.put("unit", "");
            bq.put("unit", "");
            hb.put("unit", "");
            sqhyydList.add(sq);
            bqhyydList.add(bq);
            hbhyydList.add(hb);
        }
        hyydqkData.add(sqhyydList);
        hyydqkData.add(bqhyydList);
        hyydqkData.add(hbhyydList);

        Map<String, Object> right_top_2 = new LinkedHashMap<>();
        right_top_2.put("title", "大连行业用电量情况（周）");
        right_top_2.put("legend", new String[]{
                "上期日均电量（万千瓦时）", "本期日均电量（万千瓦时）", "环比变化（%）"
        });
        right_top_2.put("data", hyydqkData);
        map2.put("right_top_2", right_top_2);

        return map2;
    }


    private Map<String, Object> getStringObjectMapp4() {
        Map<String, Object> map2 = new LinkedHashMap<>();

        String ppt = "SELECT  tplj , CONCAT( 'http://10.161.33.86:18080/dldpPro/', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = '9'";
        List<Map<String, Object>> pptRes = dldpResultService.queryInfoBySql(ppt);
        List<String> pptList = new ArrayList<>();
        for (Map<String, Object> pptRe : pptRes) {
            pptList.add(pptRe.get("img").toString());
        }
        map2.put("ppt", pptList);


        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        //台区线损达标率
        String tqxsdbl = "SELECT avg(QUALIF_RATE) qualifRate  FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) ";
        List<Map<String, Object>> tqxsdblRes = dldpResultService.queryInfoBySql(tqxsdbl);
        Map<String, Object> tqxsdblData = new LinkedHashMap<>();
        tqxsdblData.put("label", "台区线损达标率");
        tqxsdblData.put("value", tqxsdblRes.get(0).get("qualifRate") != null ? tqxsdblRes.get(0).get("qualifRate") : 0);
        tqxsdblData.put("unit", "%");
        tqxsdblData.put("label1", "环比");
        tqxsdblData.put("value1", 0);
        tqxsdblData.put("unit1", "%");

        String tqxsdblMap = "SELECT SHORT_NAME shortName,AVG(QUALIF_RATE) as qualifRATE FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) GROUP BY SHORT_NAME";
        List<Map<String, Object>> tqxsdblMapRes = dldpResultService.queryInfoBySql(tqxsdblMap);
        Map<String, Object> tqxsdblMapData = new LinkedHashMap<>();

        for (int i = 0; i < tqxsdblMapRes.size(); i++) {
            if (tqxsdblMapRes.get(i).get("shortName").equals("瓦房店市")) {
                tqxsdblMapData.put("wafangdian", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("普兰店市")) {
                tqxsdblMapData.put("pulandian", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("庄河市")) {
                tqxsdblMapData.put("zhanghe", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市开发区")) {
                tqxsdblMapData.put("kaifaqu", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("甘井子")) {
                tqxsdblMapData.put("ganjingzi", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市开发区东部")) {
                tqxsdblMapData.put("kaidong", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市长兴岛临港工业区")) {
                tqxsdblMapData.put("changxingdao", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("长海县")) {
                tqxsdblMapData.put("changhai", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("沙河口")) {
                tqxsdblMapData.put("shahekou", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("中山")) {
                tqxsdblMapData.put("zhongshan", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("高新园区")) {
                tqxsdblMapData.put("gaoxin", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市金州新区")) {
                tqxsdblMapData.put("jinzhou", tqxsdblMapRes.get(i).get("qualifRATE"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市旅顺口区")) {
                tqxsdblMapData.put("lvshun", tqxsdblMapRes.get(i).get("qualifRATE"));
            }
        }
        Map<String, Object> popDataMap1 = new LinkedHashMap<>();
        popDataMap1.put("map", tqxsdblMapData);
        popDataMap1.put("table", new LinkedHashMap<>());
        tqxsdblData.put("popData", popDataMap1);

        left_top_1.add(tqxsdblData);


        //负损台区（周）
        String fstq = "SELECT sum(NEGLL_TG_NUM) negllTgNum  FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) ";
        List<Map<String, Object>> fstqRes = dldpResultService.queryInfoBySql(fstq);
        Map<String, Object> fstqData = new LinkedHashMap<>();
        fstqData.put("label", "负损台区（周）");
        fstqData.put("value", fstqRes.get(0).get("negllTgNum") != null ? fstqRes.get(0).get("negllTgNum") : 0);
        fstqData.put("unit", "个");
        fstqData.put("label1", "环比");
        fstqData.put("value1", 0);
        fstqData.put("unit1", "个");

        String fstqMap = "SELECT SHORT_NAME shortName,sum(NEGLL_TG_NUM) as negllTgNum FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) GROUP BY SHORT_NAME";
        List<Map<String, Object>> fstqMapRes = dldpResultService.queryInfoBySql(fstqMap);
        Map<String, Object> fstqMapResMapData = new LinkedHashMap<>();
        for (int i = 0; i < fstqMapRes.size(); i++) {
            if (tqxsdblMapRes.get(i).get("shortName").equals("瓦房店市")) {
                fstqMapResMapData.put("wafangdian", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("普兰店市")) {
                fstqMapResMapData.put("pulandian", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("庄河市")) {
                fstqMapResMapData.put("zhanghe", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市开发区")) {
                fstqMapResMapData.put("kaifaqu", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("甘井子")) {
                fstqMapResMapData.put("ganjingzi", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市开发区东部")) {
                fstqMapResMapData.put("kaidong", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市长兴岛临港工业区")) {
                fstqMapResMapData.put("changxingdao", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("长海县")) {
                fstqMapResMapData.put("changhai", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("沙河口")) {
                fstqMapResMapData.put("shahekou", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("中山")) {
                fstqMapResMapData.put("zhongshan", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("高新园区")) {
                fstqMapResMapData.put("gaoxin", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市金州新区")) {
                fstqMapResMapData.put("jinzhou", fstqMapRes.get(i).get("negllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市旅顺口区")) {
                fstqMapResMapData.put("lvshun", fstqMapRes.get(i).get("negllTgNum"));
            }
        }
        Map<String, Object> popDataMap2 = new LinkedHashMap<>();
        popDataMap2.put("map", fstqMapResMapData);
        popDataMap2.put("table", map(" LL_RATE<=-0.1 "));
        fstqData.put("popData", popDataMap2);

        left_top_1.add(fstqData);


        //高损台区（周）
        String gstq = "SELECT sum(HIGHLL_TG_NUM) highllTgNum  FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) ";
        List<Map<String, Object>> gstqRes = dldpResultService.queryInfoBySql(gstq);
        Map<String, Object> gstqData = new LinkedHashMap<>();
        gstqData.put("label", "高损台区（周）");
        gstqData.put("value", gstqRes.get(0).get("highllTgNum") != null ? gstqRes.get(0).get("highllTgNum") : 0);
        gstqData.put("unit", "个");
        gstqData.put("label1", "环比");
        gstqData.put("value1", 0);
        gstqData.put("unit1", "个");

        String gstqMap = "SELECT SHORT_NAME shortName,sum(HIGHLL_TG_NUM) as highllTgNum FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) GROUP BY SHORT_NAME";
        List<Map<String, Object>> gstqMapRes = dldpResultService.queryInfoBySql(gstqMap);
        Map<String, Object> gstqMapResMapData = new LinkedHashMap<>();
        for (int i = 0; i < gstqMapRes.size(); i++) {
            if (tqxsdblMapRes.get(i).get("shortName").equals("瓦房店市")) {
                gstqMapResMapData.put("wafangdian", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("普兰店市")) {
                gstqMapResMapData.put("pulandian", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("庄河市")) {
                gstqMapResMapData.put("zhanghe", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市开发区")) {
                gstqMapResMapData.put("kaifaqu", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("甘井子")) {
                gstqMapResMapData.put("ganjingzi", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市开发区东部")) {
                gstqMapResMapData.put("kaidong", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市长兴岛临港工业区")) {
                gstqMapResMapData.put("changxingdao", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("长海县")) {
                gstqMapResMapData.put("changhai", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("沙河口")) {
                gstqMapResMapData.put("shahekou", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("中山")) {
                gstqMapResMapData.put("zhongshan", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("高新园区")) {
                gstqMapResMapData.put("gaoxin", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市金州新区")) {
                gstqMapResMapData.put("jinzhou", gstqMapRes.get(i).get("highllTgNum"));
            } else if (tqxsdblMapRes.get(i).get("shortName").equals("大连市旅顺口区")) {
                gstqMapResMapData.put("lvshun", gstqMapRes.get(i).get("highllTgNum"));
            }
        }

        Map<String, Object> popDataMap3 = new LinkedHashMap<>();
        popDataMap3.put("map", gstqMapResMapData);
        popDataMap3.put("table", map(" LL_RATE>=10 "));

        gstqData.put("popData", popDataMap3);

        left_top_1.add(gstqData);
        map2.put("left_top_1", left_top_1);


        List<Map<String, Object>> middle_left_1 = new ArrayList<>();
        //各单位台区线损达标率情况（周）
        Map<String, Object> middle_left_1_1 = new LinkedHashMap<>();
        String gdwtqxsdblqk = "SELECT SHORT_NAME shortName,sum(HIGHLL_TG_NUM) as highllTgNum,sum(NEGLL_TG_NUM) as negllTgNum,avg(QUALIF_RATE) as qualifRate\t,avg(QUALIF_RATE_LW) as qualifRateLw  FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) GROUP BY SHORT_NAME";

        List<Map<String, Object>> gdwtqxsdblqkRes = dldpResultService.queryInfoBySql(gdwtqxsdblqk);
        List<Map<String, Object>> gstqslData = new ArrayList<>();
        List<Map<String, Object>> fstqslData = new ArrayList<>();
        List<Map<String, Object>> bqdblData = new ArrayList<>();
        List<Map<String, Object>> sqdblData = new ArrayList<>();
        for (Map<String, Object> gdwtqxsdblqkRe : gdwtqxsdblqkRes) {
            Map<String, Object> gstqslres = new LinkedHashMap<>();
            Map<String, Object> fstqslres = new LinkedHashMap<>();
            Map<String, Object> bqdblres = new LinkedHashMap<>();
            Map<String, Object> sqdblres = new LinkedHashMap<>();

            if (gdwtqxsdblqkRe.get("shortName").equals("瓦房店市")) {
                gstqslres.put("name", "瓦房店");
                fstqslres.put("name", "瓦房店");
                bqdblres.put("name", "瓦房店");
                sqdblres.put("name", "瓦房店");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("普兰店市")) {
                gstqslres.put("name", "普兰店");
                fstqslres.put("name", "普兰店");
                bqdblres.put("name", "普兰店");
                sqdblres.put("name", "普兰店");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("庄河市")) {
                gstqslres.put("name", "庄河");
                fstqslres.put("name", "庄河");
                bqdblres.put("name", "庄河");
                sqdblres.put("name", "庄河");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("大连市开发区")) {
                gstqslres.put("name", "开发区");
                fstqslres.put("name", "开发区");
                bqdblres.put("name", "开发区");
                sqdblres.put("name", "开发区");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("甘井子")) {
                gstqslres.put("name", "甘井子");
                fstqslres.put("name", "甘井子");
                bqdblres.put("name", "甘井子");
                sqdblres.put("name", "甘井子");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("大连市开发区东部")) {
                gstqslres.put("name", "开区");
                fstqslres.put("name", "开区");
                bqdblres.put("name", "开区");
                sqdblres.put("name", "开区");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("大连市长兴岛临港工业区")) {
                gstqslres.put("name", "长兴岛");
                fstqslres.put("name", "长兴岛");
                bqdblres.put("name", "长兴岛");
                sqdblres.put("name", "长兴岛");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("长海县")) {
                gstqslres.put("name", "长海");
                fstqslres.put("name", "长海");
                bqdblres.put("name", "长海");
                sqdblres.put("name", "长海");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("沙河口")) {
                gstqslres.put("name", "沙河口");
                fstqslres.put("name", "沙河口");
                bqdblres.put("name", "沙河口");
                sqdblres.put("name", "沙河口");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("中山")) {
                gstqslres.put("name", "中山");
                fstqslres.put("name", "中山");
                bqdblres.put("name", "中山");
                sqdblres.put("name", "中山");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("高新园区")) {
                gstqslres.put("name", "高新");
                fstqslres.put("name", "高新");
                bqdblres.put("name", "高新");
                sqdblres.put("name", "高新");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("大连市金州新区")) {
                gstqslres.put("name", "金州");
                fstqslres.put("name", "金州");
                bqdblres.put("name", "金州");
                sqdblres.put("name", "金州");
            } else if (gdwtqxsdblqkRe.get("shortName").equals("大连市旅顺口区")) {
                gstqslres.put("name", "旅顺口");
                fstqslres.put("name", "旅顺口");
                bqdblres.put("name", "旅顺口");
                sqdblres.put("name", "旅顺口");
            }


            gstqslres.put("value", gdwtqxsdblqkRe.get("highllTgNum") != null ? gdwtqxsdblqkRe.get("highllTgNum") : 0);
            gstqslres.put("unit", "");
            gstqslData.add(gstqslres);
            fstqslres.put("value", gdwtqxsdblqkRe.get("negllTgNum") != null ? gdwtqxsdblqkRe.get("negllTgNum") : 0);
            fstqslres.put("unit", "");
            fstqslData.add(fstqslres);
            bqdblres.put("value", gdwtqxsdblqkRe.get("qualifRate") != null ? gdwtqxsdblqkRe.get("qualifRate") : 0);
            bqdblres.put("unit", "");
            bqdblData.add(bqdblres);
            sqdblres.put("value", gdwtqxsdblqkRe.get("qualifRateLw") != null ? gdwtqxsdblqkRe.get("qualifRateLw") : 0);
            sqdblres.put("unit", "");
            sqdblData.add(sqdblres);

        }
        List<List<Map<String, Object>>> middle_left_1_1Data = new ArrayList<>();
        middle_left_1_1Data.add(gstqslData);
        middle_left_1_1Data.add(fstqslData);
        middle_left_1_1Data.add(bqdblData);
        middle_left_1_1Data.add(sqdblData);

        middle_left_1_1.put("label", "各单位台区线损达标率情况（周）");
        middle_left_1_1.put("legend", new String[]{"高损台区数量（个）", "负损台区数量（个）", "本期台区达标率（%）", "上期台区达标率（%）"});
        middle_left_1_1.put("data", middle_left_1_1Data);
        middle_left_1.add(middle_left_1_1);

        //各单位台区线损率情况
        Map<String, Object> middle_left_1_2 = new LinkedHashMap<>();
        String gdwtqxslqk = "SELECT SHORT_NAME shortName, avg(LL_RATE) as llRate,avg(LL_RATE_LW) llRateLw,TRUNCATE((avg(LL_RATE)-avg(LL_RATE_LW))/avg(LL_RATE_LW),2) tb FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_tgll_stat_week ) GROUP BY SHORT_NAME";
        List<Map<String, Object>> gdwtqxslqkRes = dldpResultService.queryInfoBySql(gdwtqxslqk);
        List<Map<String, Object>> bqxslData = new ArrayList<>();
        List<Map<String, Object>> sqxslData = new ArrayList<>();
        List<Map<String, Object>> hbData = new ArrayList<>();
        for (Map<String, Object> gdwtqxslqkRe : gdwtqxslqkRes) {
            Map<String, Object> bqxslRes = new LinkedHashMap<>();
            Map<String, Object> sqxslRes = new LinkedHashMap<>();
            Map<String, Object> hbRes = new LinkedHashMap<>();

            if (gdwtqxslqkRe.get("shortName").equals("瓦房店市")) {
                bqxslRes.put("name", "瓦房店");
                sqxslRes.put("name", "瓦房店");
                hbRes.put("name", "瓦房店");
            } else if (gdwtqxslqkRe.get("shortName").equals("普兰店市")) {
                bqxslRes.put("name", "普兰店");
                sqxslRes.put("name", "普兰店");
                hbRes.put("name", "普兰店");
            } else if (gdwtqxslqkRe.get("shortName").equals("庄河市")) {
                bqxslRes.put("name", "庄河");
                sqxslRes.put("name", "庄河");
                hbRes.put("name", "庄河");
            } else if (gdwtqxslqkRe.get("shortName").equals("大连市开发区")) {
                bqxslRes.put("name", "开发区");
                sqxslRes.put("name", "开发区");
                hbRes.put("name", "开发区");
            } else if (gdwtqxslqkRe.get("shortName").equals("甘井子")) {
                bqxslRes.put("name", "甘井子");
                sqxslRes.put("name", "甘井子");
                hbRes.put("name", "甘井子");
            } else if (gdwtqxslqkRe.get("shortName").equals("大连市开发区东部")) {
                bqxslRes.put("name", "开区");
                sqxslRes.put("name", "开区");
                hbRes.put("name", "开区");
            } else if (gdwtqxslqkRe.get("shortName").equals("大连市长兴岛临港工业区")) {
                bqxslRes.put("name", "长兴岛");
                sqxslRes.put("name", "长兴岛");
                hbRes.put("name", "长兴岛");
            } else if (gdwtqxslqkRe.get("shortName").equals("长海县")) {
                bqxslRes.put("name", "长海");
                sqxslRes.put("name", "长海");
                hbRes.put("name", "长海");
            } else if (gdwtqxslqkRe.get("shortName").equals("沙河口")) {
                bqxslRes.put("name", "沙河口");
                sqxslRes.put("name", "沙河口");
                hbRes.put("name", "沙河口");
            } else if (gdwtqxslqkRe.get("shortName").equals("中山")) {
                bqxslRes.put("name", "中山");
                sqxslRes.put("name", "中山");
                hbRes.put("name", "中山");
            } else if (gdwtqxslqkRe.get("shortName").equals("高新园区")) {
                bqxslRes.put("name", "高新");
                sqxslRes.put("name", "高新");
                hbRes.put("name", "高新");
            } else if (gdwtqxslqkRe.get("shortName").equals("大连市金州新区")) {
                bqxslRes.put("name", "金州");
                sqxslRes.put("name", "金州");
                hbRes.put("name", "金州");
            } else if (gdwtqxslqkRe.get("shortName").equals("大连市旅顺口区")) {
                bqxslRes.put("name", "旅顺口");
                sqxslRes.put("name", "旅顺口");
                hbRes.put("name", "旅顺口");
            }

            bqxslRes.put("value", gdwtqxslqkRe.get("llRate") != null ? gdwtqxslqkRe.get("llRate") : 0);
            bqxslRes.put("unit", "");
            bqxslData.add(bqxslRes);
            sqxslRes.put("value", gdwtqxslqkRe.get("llRateLw") != null ? gdwtqxslqkRe.get("llRateLw") : 0);
            sqxslRes.put("unit", "");
            sqxslData.add(sqxslRes);
            hbRes.put("value", gdwtqxslqkRe.get("tb") != null ? gdwtqxslqkRe.get("tb") : 0);
            hbRes.put("unit", "");
            hbData.add(hbRes);
        }
        List<List<Map<String, Object>>> middle_left_1_2Data = new ArrayList<>();
        middle_left_1_2Data.add(bqxslData);
        middle_left_1_2Data.add(sqxslData);
        middle_left_1_2Data.add(hbData);

        middle_left_1_2.put("label", "各单位台区线损率情况");
        middle_left_1_2.put("legend", new String[]{"本期线损率", "上期线损率", "环比"});
        middle_left_1_2.put("data", middle_left_1_2Data);
        middle_left_1.add(middle_left_1_2);

        map2.put("middle_left_1", middle_left_1);

        List<Map<String, Object>> middle_left_2 = new ArrayList<>();
        String dblzg = "SELECT SHORT_NAME shortName,avg(QUALIF_RATE)  qualifRate FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) GROUP BY SHORT_NAME order by avg(QUALIF_RATE) desc limit 1";
        Map<String, Object> dblzgRes = dldpResultService.queryInfoBySql2(dblzg);
        Map<String, Object> dblzgData = new LinkedHashMap<>();
        dblzgData.put("title", "达标率最高");

        if (dblzgRes.get("shortName").equals("瓦房店市")) {
            dblzgData.put("label", "瓦房店");
        } else if (dblzgRes.get("shortName").equals("普兰店市")) {
            dblzgData.put("label", "普兰店");
        } else if (dblzgRes.get("shortName").equals("庄河市")) {
            dblzgData.put("label", "庄河");
        } else if (dblzgRes.get("shortName").equals("大连市开发区")) {
            dblzgData.put("label", "开发区");
        } else if (dblzgRes.get("shortName").equals("甘井子")) {
            dblzgData.put("label", "甘井子");
        } else if (dblzgRes.get("shortName").equals("大连市开发区东部")) {
            dblzgData.put("label", "开区");
        } else if (dblzgRes.get("shortName").equals("大连市长兴岛临港工业区")) {
            dblzgData.put("label", "长兴岛");
        } else if (dblzgRes.get("shortName").equals("长海县")) {
            dblzgData.put("label", "长海");
        } else if (dblzgRes.get("shortName").equals("沙河口")) {
            dblzgData.put("label", "沙河口");
        } else if (dblzgRes.get("shortName").equals("中山")) {
            dblzgData.put("label", "中山");
        } else if (dblzgRes.get("shortName").equals("高新园区")) {
            dblzgData.put("label", "高新");
        } else if (dblzgRes.get("shortName").equals("大连市金州新区")) {
            dblzgData.put("label", "金州");
        } else if (dblzgRes.get("shortName").equals("大连市旅顺口区")) {
            dblzgData.put("label", "旅顺口");
        }
        dblzgData.put("value", dblzgRes.get("qualifRate") != null ? dblzgRes.get("qualifRate") : 0);
        dblzgData.put("unit", "%");
        middle_left_2.add(dblzgData);

        String dbltszg = " SELECT SHORT_NAME shortName,avg(QUALIF_RATE)-avg(QUALIF_RATE_LW) qualifRate FROM szqdzxindex.dws_itg_idn_tgll_stat_week WHERE STAT_CYCLE = ( SELECT MAX( STAT_CYCLE ) FROM szqdzxindex.dws_itg_idn_tgll_stat_week) GROUP BY SHORT_NAME order by avg(QUALIF_RATE)-avg(QUALIF_RATE_LW) desc limit 1";
        Map<String, Object> dbltszgRes = dldpResultService.queryInfoBySql2(dbltszg);
        Map<String, Object> dbltszdData = new LinkedHashMap<>();
        dbltszdData.put("title", "达标率提升最大");
        if (dbltszgRes.get("shortName").equals("瓦房店市")) {
            dbltszdData.put("label", "瓦房店");
        } else if (dbltszgRes.get("shortName").equals("普兰店市")) {
            dbltszdData.put("label", "普兰店");
        } else if (dbltszgRes.get("shortName").equals("庄河市")) {
            dbltszdData.put("label", "庄河");
        } else if (dbltszgRes.get("shortName").equals("大连市开发区")) {
            dbltszdData.put("label", "开发区");
        } else if (dbltszgRes.get("shortName").equals("甘井子")) {
            dbltszdData.put("label", "甘井子");
        } else if (dbltszgRes.get("shortName").equals("大连市开发区东部")) {
            dbltszdData.put("label", "开区");
        } else if (dbltszgRes.get("shortName").equals("大连市长兴岛临港工业区")) {
            dbltszdData.put("label", "长兴岛");
        } else if (dbltszgRes.get("shortName").equals("长海县")) {
            dbltszdData.put("label", "长海");
        } else if (dbltszgRes.get("shortName").equals("沙河口")) {
            dbltszdData.put("label", "沙河口");
        } else if (dbltszgRes.get("shortName").equals("中山")) {
            dbltszdData.put("label", "中山");
        } else if (dbltszgRes.get("shortName").equals("高新园区")) {
            dbltszdData.put("label", "高新");
        } else if (dbltszgRes.get("shortName").equals("大连市金州新区")) {
            dbltszdData.put("label", "金州");
        } else if (dbltszgRes.get("shortName").equals("大连市旅顺口区")) {
            dbltszdData.put("label", "旅顺口");
        }
        dbltszdData.put("value", dbltszgRes.get("qualifRate") != null ? dbltszgRes.get("qualifRate") : 0);
        dbltszdData.put("unit", "%");
        middle_left_2.add(dbltszdData);
        map2.put("middle_left_2", middle_left_2);

        return map2;
    }

    private Map<String, Object> getStringObjectMapp6_1new() {
        Map<String, Object> map2 = new LinkedHashMap<>();

        String ppt = "SELECT  tplj , CONCAT( 'http://10.161.33.86:18080/dldpPro/', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = '10'";
        List<Map<String, Object>> pptRes = dldpResultService.queryInfoBySql(ppt);
        List<String> pptList = new ArrayList<>();
        for (Map<String, Object> pptRe : pptRes) {
            pptList.add(pptRe.get("img").toString());
        }
        map2.put("ppt", pptList);

        //在建配农网工程
        String zjpnwgc = "select count(DISTINCT project_name) zjgczs from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='农网改造'";
        Map<String, Object> pnwgcResult = dldpResultService.queryInfoBySql2(zjpnwgc);
        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        Map<String, Object> left_top_1_1 = new LinkedHashMap<>();
        left_top_1_1.put("label", "在建配农网工程");
        left_top_1_1.put("value", pnwgcResult.get("zjgczs"));
        left_top_1_1.put("unit", "项");
        left_top_1.add(left_top_1_1);

        //总投资
        String ztzeSql = "select sum(a.ztz)/10000 ztz from (select max(ztz_money) ztz,project_name from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='农网改造' group by project_name) a";
        Map<String, Object> ztzeResult = dldpResultService.queryInfoBySql2(ztzeSql);
        Map<String, Object> left_top_1_2 = new LinkedHashMap<>();
        left_top_1_2.put("label", "总投资");
        left_top_1_2.put("value", ztzeResult.get("ztz"));
        left_top_1_2.put("unit", "亿元");
        left_top_1.add(left_top_1_2);

        //存在超期项目
        String czxqxm = "select count(DISTINCT project_name) czxqxm from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='农网改造' and overdue='已逾'";
        Map<String, Object> czxqxmResult = dldpResultService.queryInfoBySql2(czxqxm);
        Map<String, Object> left_top_1_3 = new LinkedHashMap<>();
        left_top_1_3.put("label", "存在超期项目");
        left_top_1_3.put("value", czxqxmResult.get("czxqxm"));
        left_top_1_3.put("unit", "项");
        left_top_1.add(left_top_1_3);
        map2.put("left_top_1", left_top_1);

        List<Map<String, Object>> left_top_2 = new ArrayList<>();
        String[] lcxms = new String[]{"1设计院初设", "2初设批复", "3服务合同签订", "4开工前期准备", "5工程施工中", "6结算资料准备", "7外审中", "8经研所结算复核", "9审计资料准备", "10结算审计中", "11财务决算", "12归档完成"};
        String lcxmsSql = "select count(DISTINCT project_name) cou,link_node_small zjgczs from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='农网改造' group by link_node_small";
        List<Map<String, Object>> lcxmsResult = dldpResultService.queryInfoBySql(lcxmsSql);
        for (int i = 0; i < lcxms.length; i++) {
            Map<String, Object> temp = new LinkedHashMap<>();
            if (lcxms[i] == "11财务决算") {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : lcxmsResult) {
                    if (lcxmsRe.get("zjgczs").equals("11决算资料准备  ") || lcxmsRe.get("zjgczs").equals("12财务决算")) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            } else if (lcxms[i] == "12归档完成") {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : lcxmsResult) {
                    if (lcxmsRe.get("zjgczs").equals("13归档资料准备") || lcxmsRe.get("zjgczs").equals("14归档完成")) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            } else {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : lcxmsResult) {

                    if (lcxmsRe.get("zjgczs").equals(lcxms[i])) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }

                }
                temp.put("value", total);
                temp.put("unit", "项");
            }
            left_top_2.add(temp);
        }
        map2.put("left_top_2", left_top_2);

        Map<String, Object> left_top_3 = new LinkedHashMap<>();
        left_top_3.put("label", "各单位配农网工程推进情况");
        String[] left_top_3_legend = new String[]{"未开工", "施工中", "已竣工"};
        left_top_3.put("legend", left_top_3_legend);
        List<List<Map<String, Object>>> left_top_3_dataList = new ArrayList<>();
        String tjqkzsSql = "select count(DISTINCT project_name) cou,constr_unit_name constrUnitName  from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='农网改造' group by constr_unit_name";
        List<Map<String, Object>> tjqkZsList = dldpResultService.queryInfoBySql(tjqkzsSql);
        String[] constrUnitName = new String[]{"中山", "沙河口", "甘井子", "高新", "开发区", "开东", "旅顺", "金州", "普兰店", "瓦房店", "庄河市", "长兴岛", "长海县"};
        for (int i = 0; i < left_top_3_legend.length; i++) {
            String tjqkSql = "select count(DISTINCT project_name) cou,constr_unit_name constrUnitName from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='农网改造' and link_node_large='" + left_top_3_legend[i] + "' group by constr_unit_name";
            List<Map<String, Object>> tjqkList = dldpResultService.queryInfoBySql(tjqkSql);
            List<Map<String, Object>> tjqkListRes = new ArrayList<>();
            for (int i1 = 0; i1 < constrUnitName.length; i1++) {
                Map<String, Object> tjqkMap = new LinkedHashMap<>();
                tjqkMap.put("name", constrUnitName[i1]);
                int tjqkValue = 0;
                for (int i2 = 0; i2 < tjqkList.size(); i2++) {
                    if (constrUnitName[i1].equals(tjqkList.get(i2).get("constrUnitName"))) {
                        tjqkValue = Integer.parseInt(tjqkList.get(i2).get("cou").toString());
                    }
                }
                tjqkMap.put("value", tjqkValue);
                tjqkMap.put("unit", "");
                int tjqkTotal = 0;
                for (int i3 = 0; i3 < tjqkZsList.size(); i3++) {
                    if (constrUnitName[i1].equals(tjqkZsList.get(i3).get("constrUnitName"))) {
                        tjqkTotal = Integer.parseInt(tjqkZsList.get(i3).get("cou").toString());
                    }
                }
                tjqkMap.put("total", tjqkTotal);
                tjqkListRes.add(tjqkMap);
            }
            left_top_3_dataList.add(tjqkListRes);
        }
        left_top_3.put("data", left_top_3_dataList);
        map2.put("left_top_3", left_top_3);

        List<Map<String, Object>> right = new ArrayList<>();
        Map<String, Object> right_map1 = new LinkedHashMap<>();
        right_map1.put("label", "技改工程");
        Map<String, Object> right_1_data = new LinkedHashMap<>();

        //技改工程
        String jggc = "select count(DISTINCT project_name) jggczs from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产技改'";
        Map<String, Object> jggcResult = dldpResultService.queryInfoBySql2(jggc);
        List<Map<String, Object>> right_1_top_1 = new ArrayList<>();
        Map<String, Object> right_1_top_1_1 = new LinkedHashMap<>();
        right_1_top_1_1.put("label", "技改工程");
        right_1_top_1_1.put("value", jggcResult.get("jggczs") != null ? jggcResult.get("jggczs") : 0);
        right_1_top_1_1.put("unit", "项");
        right_1_top_1.add(right_1_top_1_1);

        //总投资
        String ztzeSql2 = "select sum(a.ztz)/10000 ztz from (select max(ztz_money) ztz,project_name from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产技改' group by project_name) a";
        Map<String, Object> ztze2Result = dldpResultService.queryInfoBySql2(ztzeSql2);
        Map<String, Object> right_1_top_1_2 = new LinkedHashMap<>();
        right_1_top_1_2.put("label", "总投资");
        if (ztze2Result != null) {
            right_1_top_1_2.put("value", ztze2Result.get("ztz") != null ? ztze2Result.get("ztz") : 0);
        }
        right_1_top_1_2.put("unit", "亿元");
        right_1_top_1.add(right_1_top_1_2);

        //存在超期项目
        String czxqxm2 = "select count(DISTINCT project_name) czxqxm from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产技改' and overdue='已逾'";
        Map<String, Object> czxqxm2Result = dldpResultService.queryInfoBySql2(czxqxm2);
        Map<String, Object> right_1_top_1_3 = new LinkedHashMap<>();
        right_1_top_1_3.put("label", "存在超期项目");
        right_1_top_1_3.put("value", czxqxm2Result.get("czxqxm"));
        right_1_top_1_3.put("unit", "项");
        right_1_top_1.add(right_1_top_1_3);
        right_1_data.put("top_1", right_1_top_1);

        List<Map<String, Object>> right_1_top_2 = new ArrayList<>();
        String jggclcxmsSql = "select count(DISTINCT project_name) cou,link_node_small zjgczs from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产技改' group by link_node_small";
        List<Map<String, Object>> jggclcxmsResult = dldpResultService.queryInfoBySql(jggclcxmsSql);
        for (int i = 0; i < lcxms.length; i++) {
            Map<String, Object> temp = new LinkedHashMap<>();
            if (lcxms[i] == "11财务决算") {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : jggclcxmsResult) {
                    if (lcxmsRe.get("zjgczs").equals("11决算资料准备") || lcxmsRe.get("zjgczs").equals("12财务决算")) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            } else if (lcxms[i] == "12归档完成") {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : jggclcxmsResult) {
                    if (lcxmsRe.get("zjgczs").equals("13归档资料准备") || lcxmsRe.get("zjgczs").equals("14归档完成")) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            } else {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : jggclcxmsResult) {

                    if (lcxmsRe.get("zjgczs").equals(lcxms[i])) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }

                }
                temp.put("value", total);
                temp.put("unit", "项");
            }
            right_1_top_2.add(temp);
        }
        right_1_data.put("top_2", right_1_top_2);

        Map<String, Object> right_1_top_3 = new LinkedHashMap<>();
        right_1_top_3.put("label", "各单位配农网工程推进情况");
        right_1_top_3.put("legend", left_top_3_legend);
        List<List<Map<String, Object>>> right_1_top_3_dataList = new ArrayList<>();
        String tjqkzsSql2 = "select count(DISTINCT project_name) cou,constr_unit_name constrUnitName  from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产技改' group by constr_unit_name";
        List<Map<String, Object>> tjqkZs2List = dldpResultService.queryInfoBySql(tjqkzsSql2);
        for (int i = 0; i < left_top_3_legend.length; i++) {
            String tjqkSql = "select count(DISTINCT project_name) cou,constr_unit_name constrUnitName from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产技改' and link_node_large='" + left_top_3_legend[i] + "' group by constr_unit_name";
            List<Map<String, Object>> tjqkList = dldpResultService.queryInfoBySql(tjqkSql);
            List<Map<String, Object>> tjqkListRes = new ArrayList<>();
            for (int i1 = 0; i1 < constrUnitName.length; i1++) {
                Map<String, Object> tjqkMap = new LinkedHashMap<>();
                tjqkMap.put("name", constrUnitName[i1]);
                int tjqkValue = 0;
                for (int i2 = 0; i2 < tjqkList.size(); i2++) {
                    if (constrUnitName[i1].equals(tjqkList.get(i2).get("constrUnitName"))) {
                        tjqkValue = Integer.parseInt(tjqkList.get(i2).get("cou").toString());
                    }
                }
                tjqkMap.put("value", tjqkValue);
                tjqkMap.put("unit", "");
                int tjqkTotal = 0;
                for (int i3 = 0; i3 < tjqkZs2List.size(); i3++) {
                    if (constrUnitName[i1].equals(tjqkZs2List.get(i3).get("constrUnitName"))) {
                        tjqkTotal = Integer.parseInt(tjqkZs2List.get(i3).get("cou").toString());
                    }
                }
                tjqkMap.put("total", tjqkTotal);
                tjqkListRes.add(tjqkMap);
            }
            right_1_top_3_dataList.add(tjqkListRes);
        }
        right_1_top_3.put("data", right_1_top_3_dataList);
        right_1_data.put("top_3", right_1_top_3);


        right_map1.put("data", right_1_data);
        right.add(right_map1);

        Map<String, Object> right_map2 = new LinkedHashMap<>();
        right_map2.put("label", "大修工程");
        Map<String, Object> right_2_data = new LinkedHashMap<>();

        //大修工程
        String dxgc = "select count(DISTINCT project_name) jggczs from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产大修'";
        Map<String, Object> dxgcResult = dldpResultService.queryInfoBySql2(dxgc);
        List<Map<String, Object>> right_2_top_1 = new ArrayList<>();
        Map<String, Object> right_2_top_1_1 = new LinkedHashMap<>();
        right_2_top_1_1.put("label", "大修工程");
        right_2_top_1_1.put("value", dxgcResult.get("jggczs"));
        right_2_top_1_1.put("unit", "项");
        right_2_top_1.add(right_2_top_1_1);

        //总投资
        String ztzeSql3 = "select sum(a.ztz)/10000 ztz from (select max(ztz_money) ztz,project_name from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产大修' group by project_name) a";
        Map<String, Object> ztze3Result = dldpResultService.queryInfoBySql2(ztzeSql3);
        Map<String, Object> right_2_top_1_2 = new LinkedHashMap<>();
        right_2_top_1_2.put("label", "总投资");
        if (ztze3Result != null) {
            right_2_top_1_2.put("value", ztze3Result.get("ztz") != null ? ztze3Result.get("ztz") : 0);
        }
        right_2_top_1_2.put("unit", "亿元");
        right_2_top_1.add(right_2_top_1_2);

        //存在超期项目
        String czxqxm3 = "select count(DISTINCT project_name) czxqxm from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产大修' and overdue='已逾'";
        Map<String, Object> czxqxm3Result = dldpResultService.queryInfoBySql2(czxqxm3);
        Map<String, Object> right_2_top_1_3 = new LinkedHashMap<>();
        right_2_top_1_3.put("label", "存在超期项目");
        right_2_top_1_3.put("value", czxqxm3Result.get("czxqxm"));
        right_2_top_1_3.put("unit", "项");
        right_2_top_1.add(right_2_top_1_3);
        right_2_data.put("top_1", right_2_top_1);

        List<Map<String, Object>> right_2_top_2 = new ArrayList<>();
        String dxgclcxmsSql = "select count(DISTINCT project_name) cou,link_node_small zjgczs from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产大修' group by link_node_small";
        List<Map<String, Object>> dxgclcxmsResult = dldpResultService.queryInfoBySql(dxgclcxmsSql);
        for (int i = 0; i < lcxms.length; i++) {
            Map<String, Object> temp = new LinkedHashMap<>();
            if (lcxms[i] == "11财务决算") {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : dxgclcxmsResult) {
                    if (lcxmsRe.get("zjgczs").equals("11决算资料准备") || lcxmsRe.get("zjgczs").equals("12财务决算")) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            } else if (lcxms[i] == "12归档完成") {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : dxgclcxmsResult) {
                    if (lcxmsRe.get("zjgczs").equals("13归档资料准备") || lcxmsRe.get("zjgczs").equals("14归档完成")) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            } else {
                temp.put("label", lcxms[i]);
                int total = 0;
                for (Map<String, Object> lcxmsRe : dxgclcxmsResult) {

                    if (lcxmsRe.get("zjgczs").equals(lcxms[i])) {
                        total = total + Integer.parseInt(lcxmsRe.get("cou").toString());
                    }
                }
                temp.put("value", total);
                temp.put("unit", "项");
            }
            right_2_top_2.add(temp);
        }
        right_2_data.put("top_2", right_2_top_2);

        Map<String, Object> right_2_top_3 = new LinkedHashMap<>();
        right_2_top_3.put("label", "各单位配农网工程推进情况");
        right_2_top_3.put("legend", left_top_3_legend);
        List<List<Map<String, Object>>> right_2_top_3_dataList = new ArrayList<>();
        String tjqkzsSql3 = "select count(DISTINCT project_name) cou,constr_unit_name constrUnitName  from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产大修' group by constr_unit_name";
        List<Map<String, Object>> tjqkZs3List = dldpResultService.queryInfoBySql(tjqkzsSql3);
        for (int i = 0; i < left_top_3_legend.length; i++) {
            String tjqkSql = "select count(DISTINCT project_name) cou,constr_unit_name constrUnitName from szqdzxindex.prod_engr_detail where  update_time=(select MAX(update_time) from szqdzxindex.prod_engr_detail) and engr_category='生产大修' and link_node_large='" + left_top_3_legend[i] + "' group by constr_unit_name";
            List<Map<String, Object>> tjqkList = dldpResultService.queryInfoBySql(tjqkSql);
            List<Map<String, Object>> tjqkListRes = new ArrayList<>();
            for (int i1 = 0; i1 < constrUnitName.length; i1++) {
                Map<String, Object> tjqkMap = new LinkedHashMap<>();
                tjqkMap.put("name", constrUnitName[i1]);
                int tjqkValue = 0;
                for (int i2 = 0; i2 < tjqkList.size(); i2++) {
                    if (constrUnitName[i1].equals(tjqkList.get(i2).get("constrUnitName"))) {
                        tjqkValue = Integer.parseInt(tjqkList.get(i2).get("cou").toString());
                    }
                }
                tjqkMap.put("value", tjqkValue);
                tjqkMap.put("unit", "");
                int tjqkTotal = 0;
                for (int i3 = 0; i3 < tjqkZs3List.size(); i3++) {
                    if (constrUnitName[i1].equals(tjqkZs3List.get(i3).get("constrUnitName"))) {
                        tjqkTotal = Integer.parseInt(tjqkZs3List.get(i3).get("cou").toString());
                    }
                }
                tjqkMap.put("total", tjqkTotal);
                tjqkListRes.add(tjqkMap);
            }
            right_2_top_3_dataList.add(tjqkListRes);
        }
        right_2_top_3.put("data", right_2_top_3_dataList);
        right_2_data.put("top_3", right_2_top_3);


        right_map2.put("data", right_2_data);
        right.add(right_map2);

        map2.put("right", right);

        //低压“三零”工程项目
        List<Map<String, Object>> bottom_top_1 = new ArrayList<>();
        String slgcxmSql = "select dt_project_anount as projectAnount,project_sp as projectSp,project_sp_zb as spZb,project_jiesuan as projectJiesuan,project_jiesuan_zb as jiesuanZb,project_juesuan as projectJuesuan,project_juesuan_zb as juesuanZb,gd,gd_zb as gdZb from szqdzxindex.three_zero_project_low_tension where  update_time=(select MAX(update_time) from szqdzxindex.three_zero_project_low_tension)";
        Map<String, Object> slgcxmRes = dldpResultService.queryInfoBySql2(slgcxmSql);
        Map<String, Object> bottom_top_1_map1 = new LinkedHashMap<>();
        bottom_top_1_map1.put("label", "低压“三零”工程项目");
        bottom_top_1_map1.put("value", slgcxmRes.get("projectAnount"));
        bottom_top_1_map1.put("unit", "项");
        bottom_top_1.add(bottom_top_1_map1);
        Map<String, Object> bottom_top_1_map2 = new LinkedHashMap<>();
        bottom_top_1_map2.put("label", "项目审批");
        bottom_top_1_map2.put("value", slgcxmRes.get("projectSp"));
        bottom_top_1_map2.put("unit", "项");
        bottom_top_1.add(bottom_top_1_map2);
        Map<String, Object> bottom_top_1_map3 = new LinkedHashMap<>();
        bottom_top_1_map3.put("label", "占总量");
        bottom_top_1_map3.put("value", slgcxmRes.get("spZb"));
        bottom_top_1_map3.put("unit", "%");
        bottom_top_1.add(bottom_top_1_map3);
        Map<String, Object> bottom_top_1_map4 = new LinkedHashMap<>();
        bottom_top_1_map4.put("label", "工程结算");
        bottom_top_1_map4.put("value", slgcxmRes.get("projectJiesuan"));
        bottom_top_1_map4.put("unit", "项");
        bottom_top_1.add(bottom_top_1_map4);
        Map<String, Object> bottom_top_1_map5 = new LinkedHashMap<>();
        bottom_top_1_map5.put("label", "占总量");
        bottom_top_1_map5.put("value", slgcxmRes.get("jiesuanZb"));
        bottom_top_1_map5.put("unit", "%");
        bottom_top_1.add(bottom_top_1_map5);
        Map<String, Object> bottom_top_1_map6 = new LinkedHashMap<>();
        bottom_top_1_map6.put("label", "工程决算");
        bottom_top_1_map6.put("value", slgcxmRes.get("projectJuesuan"));
        bottom_top_1_map6.put("unit", "项");
        bottom_top_1.add(bottom_top_1_map6);
        Map<String, Object> bottom_top_1_map7 = new LinkedHashMap<>();
        bottom_top_1_map7.put("label", "占总量");
        bottom_top_1_map7.put("value", slgcxmRes.get("juesuanZb"));
        bottom_top_1_map7.put("unit", "%");
        bottom_top_1.add(bottom_top_1_map7);
        Map<String, Object> bottom_top_1_map8 = new LinkedHashMap<>();
        bottom_top_1_map8.put("label", "已完成归档");
        bottom_top_1_map8.put("value", slgcxmRes.get("gd"));
        bottom_top_1_map8.put("unit", "项");
        bottom_top_1.add(bottom_top_1_map8);
        Map<String, Object> bottom_top_1_map9 = new LinkedHashMap<>();
        bottom_top_1_map9.put("label", "占总量");
        bottom_top_1_map9.put("value", slgcxmRes.get("gdZb"));
        bottom_top_1_map9.put("unit", "%");
        bottom_top_1.add(bottom_top_1_map9);

        map2.put("bottom_top_1", bottom_top_1);


        List<Map<String, Object>> bottom_1 = new ArrayList<>();
        String bottom_1_sql = "select lxtb_file_anount as lxtbFileAnount,sjy_design_anout as sjyDesignAnout,jyy_review_hbpfgc as jyyReviewHbpfgc,jyy_review_anount as jyyReviewAnount,csyj_reply_anount as csyjReplyAnount,funding_plan_anount as fundingPlanAnount,jiesuan_file_prepare_anount as jiesuanFilePrepareAnount,sj_file_hz_anount as sjFileHzAnount,ns_anount as nsAnount,juesuan_file_hz_anount as juesuanFileHzAnount,finance_js_anount as financeJsAnount,gd_anount as gdAnount from szqdzxindex.three_zero_project_in_transit where  update_time=(select MAX(update_time) from szqdzxindex.three_zero_project_in_transit) and fgs_name='大连供电公司'";
        Map<String, Object> bottom1Res = dldpResultService.queryInfoBySql2(bottom_1_sql);
        //立项材料提报
        Map<String, Object> bottom1Data1 = new LinkedHashMap<>();
        bottom1Data1.put("label", "立项材料提报");
        bottom1Data1.put("value", bottom1Res.get("lxtbFileAnount"));
        bottom1Data1.put("unit", "项");
        bottom_1.add(bottom1Data1);
        //设计院设计
        Map<String, Object> bottom1Data2 = new LinkedHashMap<>();
        bottom1Data2.put("label", "设计院设计");
        bottom1Data2.put("value", bottom1Res.get("sjyDesignAnout"));
        bottom1Data2.put("unit", "项");
        bottom_1.add(bottom1Data2);

        //经研院合并批复工程
        Map<String, Object> bottom1Data3 = new LinkedHashMap<>();
        bottom1Data3.put("label", "经研院合并批复工程");
        bottom1Data3.put("value", bottom1Res.get("jyyReviewHbpfgc"));
        bottom1Data3.put("unit", "项");
        bottom_1.add(bottom1Data3);

        //经研院评审
        Map<String, Object> bottom1Data4 = new LinkedHashMap<>();
        bottom1Data4.put("label", "经研院评审");
        bottom1Data4.put("value", bottom1Res.get("jyyReviewAnount"));
        bottom1Data4.put("unit", "项");
        bottom_1.add(bottom1Data4);

        //初设意见批复
        Map<String, Object> bottom1Data5 = new LinkedHashMap<>();
        bottom1Data5.put("label", "初设意见批复");
        bottom1Data5.put("value", bottom1Res.get("csyjReplyAnount"));
        bottom1Data5.put("unit", "项");
        bottom_1.add(bottom1Data5);

        //下达资金计划
        Map<String, Object> bottom1Data6 = new LinkedHashMap<>();
        bottom1Data6.put("label", "下达资金计划");
        bottom1Data6.put("value", bottom1Res.get("fundingPlanAnount"));
        bottom1Data6.put("unit", "项");
        bottom_1.add(bottom1Data6);

        //结算材料准备
        Map<String, Object> bottom1Data7 = new LinkedHashMap<>();
        bottom1Data7.put("label", "结算材料准备");
        bottom1Data7.put("value", bottom1Res.get("jiesuanFilePrepareAnount"));
        bottom1Data7.put("unit", "项");
        bottom_1.add(bottom1Data7);

        //审计资料汇总
        Map<String, Object> bottom1Data8 = new LinkedHashMap<>();
        bottom1Data8.put("label", "审计资料汇总");
        bottom1Data8.put("value", bottom1Res.get("sjFileHzAnount"));
        bottom1Data8.put("unit", "项");
        bottom_1.add(bottom1Data8);

        //内审
        Map<String, Object> bottom1Data9 = new LinkedHashMap<>();
        bottom1Data9.put("label", "内审");
        bottom1Data9.put("value", bottom1Res.get("nsAnount"));
        bottom1Data9.put("unit", "项");
        bottom_1.add(bottom1Data9);

        //决算材料汇总
        Map<String, Object> bottom1Data10 = new LinkedHashMap<>();
        bottom1Data10.put("label", "决算材料汇总");
        bottom1Data10.put("value", bottom1Res.get("juesuanFileHzAnount"));
        bottom1Data10.put("unit", "项");
        bottom_1.add(bottom1Data10);

        //决算材料汇总
        Map<String, Object> bottom1Data11 = new LinkedHashMap<>();
        bottom1Data11.put("label", "财务决算");
        bottom1Data11.put("value", bottom1Res.get("financeJsAnount"));
        bottom1Data11.put("unit", "项");
        bottom_1.add(bottom1Data11);

        //归档
        Map<String, Object> bottom1Data12 = new LinkedHashMap<>();
        bottom1Data12.put("label", "归档");
        bottom1Data12.put("value", bottom1Res.get("gdAnount"));
        bottom1Data12.put("unit", "项");
        bottom_1.add(bottom1Data12);
        map2.put("bottom_1", bottom_1);

        Map<String, Object> bottom_2 = new LinkedHashMap<>();

        List<Head> heads = new ArrayList<>();
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("fgsName").width(8).label("单位").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("dtProjectAnount").width(4).label("单体工程总数量").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("lxtbFileAnount").width(4).label("立项材料提报-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("lxtbFileZb").width(4).label("立项材料提报-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("sjyDesignAnout").width(4).label("设计院设计-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("sjyDesignZb").width(4).label("设计院设计-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("jyyReviewAnount").width(4).label("经研院评审-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("jyyReviewZb").width(4).label("经研院评审-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("csyjReplyAnount").width(4).label("初设意见批复-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("csyjReplyZb").width(4).label("初设意见批复-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("fundingPlanAnount").width(4).label("下达资金计划-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("fundingPlanZb").width(4).label("下达资金计划-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("jiesuanFilePrepareAnount").width(4).label("结算材料准备-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("jiesuanFilePrepareZb").width(4).label("结算材料准备-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("sjFileHzAnount").width(4).label("审计资料汇总-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("sjFileHzZb").width(4).label("审计资料汇总-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("nsAnount").width(4).label("内审-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("nsZb").width(4).label("内审-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("juesuanFileHzAnount").width(4).label("决算材料汇总-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("juesuanFileHzZb").width(4).label("决算材料汇总-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("financeJsAnount").width(4).label("财务决算-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("financeJsZb").width(4).label("财务决算-占比").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("gdAnount").width(4).label("归档-总数").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("gdZb").width(4).label("归档-占比").build());

        String bottom_2_sql = "SELECT lxtb_file_anount AS lxtbFileAnount,lxtb_file_zb as lxtbFileZb,sjy_design_anout as sjyDesignAnout,sjy_design_zb as sjyDesignZb,jyy_review_anount as jyyReviewAnount,jyy_review_zb as jyyReviewZb,csyj_reply_anount as csyjReplyAnount,csyj_reply_zb as csyjReplyZb,funding_plan_anount as fundingPlanAnount,funding_plan_zb as fundingPlanZb,jiesuan_file_prepare_anount as jiesuanFilePrepareAnount,jiesuan_file_prepare_zb as jiesuanFilePrepareZb,sj_file_hz_anount as sjFileHzAnount,sj_file_hz_zb as sjFileHzZb,ns_anount as nsAnount,ns_zb as nsZb,juesuan_file_hz_anount as juesuanFileHzAnount,juesuan_file_hz_zb as juesuanFileHzZb,finance_js_anount as financeJsAnount,finance_js_zb as financeJsZb,gd_anount as gdAnount,gd_zb as gdZb,fgs_name as fgsName,dt_project_anount as dtProjectAnount FROM szqdzxindex.three_zero_project_in_transit WHERE update_time =(SELECT MAX( update_time ) FROM szqdzxindex.three_zero_project_in_transit ) AND fgs_name != '大连供电公司'";

        List<Map<String, Object>> result2 = dldpResultService.queryInfoBySql(bottom_2_sql);
        List<Map<String, Object>> list = new ArrayList<>();
        for (int i = 0; i < result2.size(); i++) {


            result2.get(i).put("lxtbFileZb", result2.get(i).get("lxtbFileZb").toString().replace("%", ""));
            result2.get(i).put("sjyDesignZb", result2.get(i).get("sjyDesignZb").toString().replace("%", ""));
            result2.get(i).put("jyyReviewZb", result2.get(i).get("jyyReviewZb").toString().replace("%", ""));
            result2.get(i).put("csyjReplyZb", result2.get(i).get("csyjReplyZb").toString().replace("%", ""));
            result2.get(i).put("fundingPlanZb", result2.get(i).get("fundingPlanZb").toString().replace("%", ""));
            result2.get(i).put("jiesuanFilePrepareZb", result2.get(i).get("jiesuanFilePrepareZb").toString().replace("%", ""));
            result2.get(i).put("sjFileHzZb", result2.get(i).get("sjFileHzZb").toString().replace("%", ""));
            result2.get(i).put("nsZb", result2.get(i).get("nsZb").toString().replace("%", ""));
            result2.get(i).put("juesuanFileHzZb", result2.get(i).get("juesuanFileHzZb").toString().replace("%", ""));
            result2.get(i).put("financeJsZb", result2.get(i).get("financeJsZb").toString().replace("%", ""));
            result2.get(i).put("gdZb", result2.get(i).get("gdZb").toString().replace("%", ""));
            list.add(result2.get(i));
        }
        bottom_2.put("head", heads);
        bottom_2.put("data", list);

        map2.put("bottom_2", bottom_2);


        return map2;
    }

    private Map<String, Object> getStringObjectMapp6_2() {
        Map<String, Object> map2 = new LinkedHashMap<>();

        String zgcs = "select sum(jggcgcs) jggcgcs,sum(jggctze) jggctze,sum(dxgcgcs) dxgcgcs,sum(dxgctze) dxgctze from gcgl_gcztqk where zbqs = (select max(zbqs) from gcgl_gcztqk) group by zbqs";
        List<Map<String, Object>> zgcsResult = dldpResultService.queryInfoBySql(zgcs);
        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        Map<String, Object> left_top_1_map1 = new LinkedHashMap<>();

        Map<String, Object> left_top_1_map2 = new LinkedHashMap<>();
        Map<String, Object> left_top_1_map3 = new LinkedHashMap<>();
        left_top_1_map3.put("label", "在建技改工程");
        left_top_1_map3.put("value", zgcsResult.get(0).get("jggcgcs"));
        left_top_1_map3.put("unit", "");
        left_top_1_map3.put("unit1", "项");

        Map<String, Object> left_top_1_map4 = new LinkedHashMap<>();
        left_top_1_map4.put("label", "投资");
        left_top_1_map4.put("value", zgcsResult.get(0).get("jggctze"));
        left_top_1_map4.put("unit", "亿");
        left_top_1_map4.put("unit1", "元");
        Map<String, Object> left_top_1_map5 = new LinkedHashMap<>();
        left_top_1_map5.put("label", "在建大修工程");
        left_top_1_map5.put("value", zgcsResult.get(0).get("dxgcgcs"));
        left_top_1_map5.put("unit", "");
        left_top_1_map5.put("unit1", "项");
        Map<String, Object> left_top_1_map6 = new LinkedHashMap<>();
        left_top_1_map6.put("label", "投资");
        left_top_1_map6.put("value", zgcsResult.get(0).get("dxgctze"));
        left_top_1_map6.put("unit", "亿");
        left_top_1_map6.put("unit1", "元");

        left_top_1_map1.put("label", "公司在建技改大修工程");
        left_top_1_map1.put("value", Integer.parseInt(left_top_1_map3.get("value").toString()) + Integer.parseInt(left_top_1_map5.get("value").toString()));
        left_top_1_map1.put("unit", "");
        left_top_1_map1.put("unit1", "项");

        left_top_1_map2.put("label", "总投资");
        left_top_1_map2.put("value", Double.parseDouble(left_top_1_map4.get("value").toString()) + Double.parseDouble(left_top_1_map6.get("value").toString()));
        left_top_1_map2.put("unit", "亿");
        left_top_1_map2.put("unit1", "元");
        left_top_1.add(left_top_1_map1);
        left_top_1.add(left_top_1_map2);
        left_top_1.add(left_top_1_map3);
        left_top_1.add(left_top_1_map4);
        left_top_1.add(left_top_1_map5);
        left_top_1.add(left_top_1_map6);

        map2.put("left_top_1", left_top_1);

        List<Map<String, Object>> left_top_2_1 = new ArrayList<>();
        String gndgctj = "select nd,max(jggcgcs)+max(dxgcgcs) zs from gcgl_gcztqk where zbqs = (select max(zbqs) from gcgl_gcztqk) group by nd";
        List<Map<String, Object>> gndgctjResult = dldpResultService.queryInfoBySql(gndgctj);

        Map<String, Object> left_top_2_1_1 = new LinkedHashMap<>();
        left_top_2_1_1.put("label", "各年度技改大修工程分布情况");
        List<Map<String, Object>> left_top_2_1_data = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : gndgctjResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("nd"));
            res.put("value", stringObjectMap.get("zs"));
            res.put("unit", "项");
            left_top_2_1_data.add(res);
        }
        left_top_2_1_1.put("data", new Object[]{left_top_2_1_data});
        left_top_2_1.add(left_top_2_1_1);

        String jggctjqk = "select * from gcgl_gctjqk where zbqs = (select max(zbqs) from gcgl_gctjqk) and lx='0'";
        List<Map<String, Object>> jggctjqkResult = dldpResultService.queryInfoBySql(jggctjqk);

        Map<String, Object> left_top_2_1_2 = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_2_1_2_data = new ArrayList<>();
        left_top_2_1_2.put("label", "技改工程推进情况");
        for (Map<String, Object> stringObjectMap : jggctjqkResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("zt"));
            res.put("value", stringObjectMap.get("sl"));
            res.put("unit", "项");
            left_top_2_1_2_data.add(res);
        }
        left_top_2_1_2.put("data", new Object[]{left_top_2_1_2_data});
        left_top_2_1.add(left_top_2_1_2);

        String dxgctjqk = "select * from gcgl_gctjqk where zbqs = (select max(zbqs) from gcgl_gctjqk) and lx='1'";
        List<Map<String, Object>> dxgctjqkResult = dldpResultService.queryInfoBySql(dxgctjqk);

        Map<String, Object> left_top_2_1_3 = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_2_1_3_data = new ArrayList<>();
        left_top_2_1_3.put("label", "大修工程推进情况");
        for (Map<String, Object> stringObjectMap : dxgctjqkResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("zt"));
            res.put("value", stringObjectMap.get("sl"));
            res.put("unit", "项");
            left_top_2_1_3_data.add(res);
        }
        left_top_2_1_3.put("data", new Object[]{left_top_2_1_3_data});
        left_top_2_1.add(left_top_2_1_3);
        map2.put("left_top_2_1", left_top_2_1);

        List<Map<String, Object>> left_top_2_2 = new ArrayList<>();
        String xxdjg = "select * from gcgl_xxdjggc where zbqs = (select max(zbqs) from gcgl_xxdjggc) ";
        List<Map<String, Object>> xxdjgResult = dldpResultService.queryInfoBySql(xxdjg);

        Map<String, Object> left_top_2_2_1 = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_2_2_1_data = new ArrayList<>();
        left_top_2_2_1.put("label", "新下达技改工程各单位分布情况");
        for (Map<String, Object> stringObjectMap : xxdjgResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("dw"));
            res.put("value", stringObjectMap.get("xmsl"));
            res.put("unit", "");
            left_top_2_2_1_data.add(res);
        }
        left_top_2_2_1.put("data", new Object[]{left_top_2_2_1_data});
        left_top_2_2.add(left_top_2_2_1);

        String xjjg = "select * from gcgl_xjjggc where zbqs = (select max(zbqs) from gcgl_xjjggc) ";
        List<Map<String, Object>> xjjgResult = dldpResultService.queryInfoBySql(xjjg);

        Map<String, Object> left_top_2_2_2 = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_2_2_2_data = new ArrayList<>();
        left_top_2_2_2.put("label", "续建技改工程各单位分布情况");
        for (Map<String, Object> stringObjectMap : xjjgResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("dw"));
            res.put("value", stringObjectMap.get("xmsl"));
            res.put("unit", "");
            left_top_2_2_2_data.add(res);
        }
        left_top_2_2_2.put("data", new Object[]{left_top_2_2_2_data});
        left_top_2_2.add(left_top_2_2_2);

        String dxgc = "select * from gcgl_dxgc where zbqs = (select max(zbqs) from gcgl_dxgc) ";
        List<Map<String, Object>> dxgcResult = dldpResultService.queryInfoBySql(dxgc);

        Map<String, Object> left_top_2_2_3 = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_2_2_3_data = new ArrayList<>();
        left_top_2_2_3.put("label", "大修工程各单位分布情况");
        for (Map<String, Object> stringObjectMap : dxgcResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("dw"));
            res.put("value", stringObjectMap.get("xmsl"));
            res.put("unit", "");
            left_top_2_2_3_data.add(res);
        }
        left_top_2_2_3.put("data", new Object[]{left_top_2_2_3_data});
        left_top_2_2.add(left_top_2_2_3);
        map2.put("left_top_2_2", left_top_2_2);

        return map2;
    }

    private Map<String, Object> getStringObjectMapp6_3() {
        Map<String, Object> map2 = new LinkedHashMap<>();

        String pnwgc = "select * from gcgl_pnwykgcxx where zbqs = (select max(zbqs) from gcgl_pnwykgcxx) and lx='0' ";
        List<Map<String, Object>> pnwgcResult = dldpResultService.queryInfoBySql(pnwgc);
        List<Map<String, Object>> left_top_1 = new ArrayList<>();
        Map<String, Object> left_top_1_1 = new LinkedHashMap<>();
        left_top_1_1.put("label", "在建配农网工程");
        left_top_1_1.put("value", pnwgcResult.get(0).get("gczs"));
        left_top_1_1.put("unit", "");
        left_top_1_1.put("unit1", "项");
        left_top_1.add(left_top_1_1);
        Map<String, Object> left_top_1_2 = new LinkedHashMap<>();
        left_top_1_2.put("label", "总投资");
        left_top_1_2.put("value", pnwgcResult.get(0).get("ztz"));
        left_top_1_2.put("unit", "亿");
        left_top_1_2.put("unit1", "元");
        left_top_1.add(left_top_1_2);
        Map<String, Object> left_top_1_3 = new LinkedHashMap<>();
        left_top_1_3.put("label", "新下达工程");
        left_top_1_3.put("value", pnwgcResult.get(0).get("xxdgcs"));
        left_top_1_3.put("unit", "");
        left_top_1_3.put("unit1", "项");
        left_top_1.add(left_top_1_3);
        Map<String, Object> left_top_1_4 = new LinkedHashMap<>();
        left_top_1_4.put("label", "续建工程");
        left_top_1_4.put("value", pnwgcResult.get(0).get("xjgcs"));
        left_top_1_4.put("unit", "");
        left_top_1_4.put("unit1", "项");
        left_top_1.add(left_top_1_4);
        map2.put("left_top_1", left_top_1);

        List<Map<String, Object>> left_top_2 = new ArrayList<>();

        String pnwgclxtj = "select sum(nwgzgcs) nwgzgcs,sum(wjwsgcs) wjwsgcs,sum(pwzdhgcs) pwzdhgcs,sum(ptfjjygcs) ptfjjygcs from gcgl_pnwgcztqk where zbqs = (select max(zbqs) from gcgl_pnwgcztqk) group by zbqs ";
        List<Map<String, Object>> pnwgclxtjResult = dldpResultService.queryInfoBySql(pnwgclxtj);
        Map<String, Object> left_top_2_map1 = new LinkedHashMap<>();
        List<Map<String, Object>> left_top_2_map1_data = new ArrayList<>();
        Map<String, Object> left_top_2_map1_data_1 = new LinkedHashMap<>();
        left_top_2_map1_data_1.put("name", "农网改造");
        left_top_2_map1_data_1.put("value", pnwgclxtjResult.get(0).get("nwgzgcs"));
        left_top_2_map1_data_1.put("unit", "项");
        left_top_2_map1_data.add(left_top_2_map1_data_1);
        Map<String, Object> left_top_2_map1_data_2 = new LinkedHashMap<>();
        left_top_2_map1_data_2.put("name", "网架完善");
        left_top_2_map1_data_2.put("value", pnwgclxtjResult.get(0).get("wjwsgcs"));
        left_top_2_map1_data_2.put("unit", "项");
        left_top_2_map1_data.add(left_top_2_map1_data_2);
        Map<String, Object> left_top_2_map1_data_3 = new LinkedHashMap<>();
        left_top_2_map1_data_3.put("name", "配网自动化");
        left_top_2_map1_data_3.put("value", pnwgclxtjResult.get(0).get("pwzdhgcs"));
        left_top_2_map1_data_3.put("unit", "项");
        left_top_2_map1_data.add(left_top_2_map1_data_3);

        Map<String, Object> left_top_2_map1_data_4 = new LinkedHashMap<>();
        left_top_2_map1_data_4.put("name", "配套费及结余");
        left_top_2_map1_data_4.put("value", pnwgclxtjResult.get(0).get("ptfjjygcs"));
        left_top_2_map1_data_4.put("unit", "项");
        left_top_2_map1_data.add(left_top_2_map1_data_4);
        left_top_2_map1.put("label", "配农网工程类型统计情况");
        left_top_2_map1.put("data", new Object[]{left_top_2_map1_data});

        Map<String, Object> left_top_2_map2 = new LinkedHashMap<>();
        String gdwpnwgc = "select * from gcgl_pnwgc where zbqs = (select max(zbqs) from gcgl_pnwgc) ";
        List<Map<String, Object>> gdwpnwgcResult = dldpResultService.queryInfoBySql(gdwpnwgc);
        List<Map<String, Object>> left_top_2_map2_data = new ArrayList<>();
        left_top_2_map2.put("label", "配农网工程各单位分布情况");
        for (Map<String, Object> stringObjectMap : gdwpnwgcResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("dw"));
            res.put("value", stringObjectMap.get("xmsl"));
            res.put("unit", "");
            left_top_2_map2_data.add(res);
        }
        left_top_2_map2.put("data", new Object[]{left_top_2_map2_data});
        left_top_2.add(left_top_2_map1);
        left_top_2.add(left_top_2_map2);
        map2.put("left_top_2", left_top_2);


        String ykgc = "select * from gcgl_pnwykgcxx where zbqs = (select max(zbqs) from gcgl_pnwykgcxx) and lx='1' ";
        List<Map<String, Object>> ykgcResult = dldpResultService.queryInfoBySql(ykgc);
        List<Map<String, Object>> right_top_1 = new ArrayList<>();
        Map<String, Object> right_top_1_1 = new LinkedHashMap<>();
        right_top_1_1.put("label", "在建业扩工程");
        right_top_1_1.put("value", ykgcResult.get(0).get("gczs"));
        right_top_1_1.put("unit", "");
        right_top_1_1.put("unit1", "项");
        right_top_1.add(right_top_1_1);
        Map<String, Object> right_top_1_2 = new LinkedHashMap<>();
        right_top_1_2.put("label", "在途项目");
        right_top_1_2.put("value", ykgcResult.get(0).get("ztz"));
        right_top_1_2.put("unit", "");
        right_top_1_2.put("unit1", "项");
        right_top_1.add(right_top_1_2);
        Map<String, Object> right_top_1_3 = new LinkedHashMap<>();
        right_top_1_3.put("label", "已决算归档项目");
        right_top_1_3.put("value", ykgcResult.get(0).get("xxdgcs"));
        right_top_1_3.put("unit", "");
        right_top_1_3.put("unit1", "项");
        right_top_1.add(right_top_1_3);
        Map<String, Object> right_top_1_4 = new LinkedHashMap<>();
        right_top_1_4.put("label", "取消项目");
        right_top_1_4.put("value", ykgcResult.get(0).get("xjgcs"));
        right_top_1_4.put("unit", "");
        right_top_1_4.put("unit1", "项");
        right_top_1.add(right_top_1_4);
        map2.put("right_top_1", right_top_1);

        List<Map<String, Object>> right_top_2 = new ArrayList<>();

        String ykgctjqk = "select * from gcgl_ykgctj where zbqs = (select max(zbqs) from gcgl_ykgctj) ";
        List<Map<String, Object>> ykgctjqkResult = dldpResultService.queryInfoBySql(ykgctjqk);
        Map<String, Object> right_top_2_map1 = new LinkedHashMap<>();
        List<Map<String, Object>> right_top_2_map1_data = new ArrayList<>();
        right_top_2_map1.put("label", "业扩工程推进情况");
        for (Map<String, Object> stringObjectMap : ykgctjqkResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("zt"));
            res.put("value", stringObjectMap.get("sl"));
            res.put("unit", "项");
            right_top_2_map1_data.add(res);
        }
        right_top_2_map1.put("data", new Object[]{right_top_2_map1_data});

        Map<String, Object> right_top_2_map2 = new LinkedHashMap<>();
        String gdwykgc = "select * from gcgl_ykgc where zbqs = (select max(zbqs) from gcgl_ykgc) ";
        List<Map<String, Object>> gdwykgcResult = dldpResultService.queryInfoBySql(gdwykgc);
        List<Map<String, Object>> right_top_2_map2_data = new ArrayList<>();
        right_top_2_map2.put("label", "工程在途环节分布情况");
        for (Map<String, Object> stringObjectMap : gdwykgcResult) {
            Map<String, Object> res = new LinkedHashMap<>();
            res.put("name", stringObjectMap.get("dw"));
            res.put("value", stringObjectMap.get("xmsl"));
            res.put("unit", "");
            right_top_2_map2_data.add(res);
        }
        right_top_2_map2.put("data", new Object[]{right_top_2_map2_data});
        right_top_2.add(right_top_2_map1);
        right_top_2.add(right_top_2_map2);
        map2.put("right_top_2", right_top_2);
        return map2;
    }

    private Object getValue(Map<String, Object> map, String key) {
        return map.get(key) != null ? map.get(key) : 0;
    }


    private Map<String, Object> getStringObjectMapp3_1new() {
        Map<String, Object> map2 = new LinkedHashMap<>();

        List<Map<String, Object>> left_top_1 = new ArrayList<>();

        //申请项目数
        String sqxmsSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='01' and SHORT_NAME='大连'";
        Map<String, Object> sqxmsRes = dldpResultService.queryInfoBySql2(sqxmsSql);
        String sqxmrlSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='02' and SHORT_NAME='大连'";

        Map<String, Object> sqxmrlRes = dldpResultService.queryInfoBySql2(sqxmrlSql);
        Map<String, Object> sqxmsdata = new LinkedHashMap<>();
        sqxmsdata.put("label", "申请项目数（周）");
        sqxmsdata.put("value", sqxmsRes.get("hj"));
        sqxmsdata.put("unit", "项");
        sqxmsdata.put("value1", sqxmrlRes.get("hj"));
        sqxmsdata.put("unit1", "万");
        sqxmsdata.put("unit2", "千伏安");

        left_top_1.add(sqxmsdata);

        //完成项目数
        String wcxmsSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='06' and SHORT_NAME='大连'";
        Map<String, Object> wcxmsRes = dldpResultService.queryInfoBySql2(wcxmsSql);
        String wcxmrlSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='07' and SHORT_NAME='大连'";
        Map<String, Object> wcxmrlRes = dldpResultService.queryInfoBySql2(wcxmrlSql);

        Map<String, Object> wcxmsdata = new LinkedHashMap<>();
        wcxmsdata.put("label", "完成项目数（周）");
        wcxmsdata.put("value", wcxmsRes.get("hj"));
        wcxmsdata.put("unit", "件");
        wcxmsdata.put("value1", wcxmrlRes.get("hj"));
        wcxmsdata.put("unit1", "万");
        wcxmsdata.put("unit2", "千伏安");
        left_top_1.add(wcxmsdata);

        map2.put("left_top_1", left_top_1);

        List<Map<String, Object>> left_top_2 = new ArrayList<>();
        //本期申请项目数（项）
        Map<String, Object> left_top_2_sqxmsdata = new LinkedHashMap<>();
        left_top_2_sqxmsdata.put("label", "本期申请项目数（项）");
        left_top_2_sqxmsdata.put("label1", "高压");
        left_top_2_sqxmsdata.put("value1", sqxmsRes.get("gy"));
        left_top_2_sqxmsdata.put("label2", "低压");
        left_top_2_sqxmsdata.put("value2", sqxmsRes.get("dy"));
        left_top_2.add(left_top_2_sqxmsdata);

        //本期申请容量（万千伏安、万千瓦）
        String sqrlSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='02' and SHORT_NAME='大连'";
        Map<String, Object> sqrlSqlRes = dldpResultService.queryInfoBySql2(sqrlSql);
        Map<String, Object> sqrlSqldata = new LinkedHashMap<>();
        sqrlSqldata.put("label", "本期申请容量（万千伏安、万千瓦）");
        sqrlSqldata.put("label1", "高压");
        sqrlSqldata.put("value1", sqrlSqlRes.get("gy"));
        sqrlSqldata.put("label2", "低压");
        sqrlSqldata.put("value2", sqrlSqlRes.get("dy"));
        left_top_2.add(sqrlSqldata);

        //累计申请项目数（项）
        String ljsqxmsSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='03' and SHORT_NAME='大连'";
        Map<String, Object> ljsqxmsSqlRes = dldpResultService.queryInfoBySql2(ljsqxmsSql);
        Map<String, Object> ljsqxmsSqldata = new LinkedHashMap<>();
        ljsqxmsSqldata.put("label", "累计申请项目数（项）");
        ljsqxmsSqldata.put("label1", "高压");
        ljsqxmsSqldata.put("value1", ljsqxmsSqlRes.get("gy"));
        ljsqxmsSqldata.put("label2", "低压");
        ljsqxmsSqldata.put("value2", ljsqxmsSqlRes.get("dy"));
        left_top_2.add(ljsqxmsSqldata);

        //累计申请容量（万千伏安、万千瓦）
        String ljsqrlSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='04' and SHORT_NAME='大连'";
        Map<String, Object> ljsqrlSqlRes = dldpResultService.queryInfoBySql2(ljsqrlSql);
        Map<String, Object> ljsqrlSqldata = new LinkedHashMap<>();
        ljsqrlSqldata.put("label", "累计申请容量（万千伏安、万千瓦）");
        ljsqrlSqldata.put("label1", "高压");
        ljsqrlSqldata.put("value1", ljsqrlSqlRes.get("gy"));
        ljsqrlSqldata.put("label2", "低压");
        ljsqrlSqldata.put("value2", ljsqrlSqlRes.get("dy"));
        left_top_2.add(ljsqrlSqldata);

        //累计申请容量同比（%）
        String ljsqrltbSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='05' and SHORT_NAME='大连'";
        Map<String, Object> ljsqrltbSqlRes = dldpResultService.queryInfoBySql2(ljsqrltbSql);
        Map<String, Object> ljsqrltbSqldata = new LinkedHashMap<>();
        ljsqrltbSqldata.put("label", "累计申请容量同比（%）");
        ljsqrltbSqldata.put("label1", "高压");
        ljsqrltbSqldata.put("value1", ljsqrltbSqlRes.get("gy"));
        ljsqrltbSqldata.put("label2", "低压");
        ljsqrltbSqldata.put("value2", ljsqrltbSqlRes.get("dy"));
        left_top_2.add(ljsqrltbSqldata);

        map2.put("left_top_2", left_top_2);


        List<Map<String, Object>> left_top_2_1 = new ArrayList<>();
        //本期完成项目数（项）
        Map<String, Object> left_top_2_1wcxmsdata = new LinkedHashMap<>();
        left_top_2_1wcxmsdata.put("label", "本期完成项目数（项）");
        left_top_2_1wcxmsdata.put("label1", "高压");
        left_top_2_1wcxmsdata.put("value1", wcxmsRes.get("gy"));
        left_top_2_1wcxmsdata.put("label2", "低压");
        left_top_2_1wcxmsdata.put("value2", wcxmsRes.get("dy"));
        left_top_2_1.add(left_top_2_1wcxmsdata);

        //本期完成容量（万千伏安、万千瓦）
        String wcrlSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='07' and SHORT_NAME='大连'";
        Map<String, Object> wcrlSqlSqlRes = dldpResultService.queryInfoBySql2(wcrlSql);
        Map<String, Object> wcrlSqlSqldata = new LinkedHashMap<>();
        wcrlSqlSqldata.put("label", "本期完成容量（万千伏安、万千瓦）");
        wcrlSqlSqldata.put("label1", "高压");
        wcrlSqlSqldata.put("value1", wcrlSqlSqlRes.get("gy"));
        wcrlSqlSqldata.put("label2", "低压");
        wcrlSqlSqldata.put("value2", wcrlSqlSqlRes.get("dy"));
        left_top_2_1.add(wcrlSqlSqldata);

        //累计完成项目数（项）
        String ljwcxmsSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='09' and SHORT_NAME='大连'";
        Map<String, Object> ljwcxmsSqlRes = dldpResultService.queryInfoBySql2(ljwcxmsSql);
        Map<String, Object> ljwcxmsSqldata = new LinkedHashMap<>();
        ljwcxmsSqldata.put("label", "累计完成项目数（项）");
        ljwcxmsSqldata.put("label1", "高压");
        ljwcxmsSqldata.put("value1", ljwcxmsSqlRes.get("gy"));
        ljwcxmsSqldata.put("label2", "低压");
        ljwcxmsSqldata.put("value2", ljwcxmsSqlRes.get("dy"));
        left_top_2_1.add(ljwcxmsSqldata);

        //累计完成容量（万千伏安、万千瓦）
        String ljwcrlSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='10' and SHORT_NAME='大连'";
        Map<String, Object> ljwcrlSqlRes = dldpResultService.queryInfoBySql2(ljwcrlSql);
        Map<String, Object> ljwcrlSqldata = new LinkedHashMap<>();
        ljwcrlSqldata.put("label", "累计完成容量（万千伏安、万千瓦）");
        ljwcrlSqldata.put("label1", "高压");
        ljwcrlSqldata.put("value1", ljwcrlSqlRes.get("gy"));
        ljwcrlSqldata.put("label2", "低压");
        ljwcrlSqldata.put("value2", ljwcrlSqlRes.get("dy"));
        left_top_2_1.add(ljwcrlSqldata);

        //累计完成容量同比（%）
        String ljwcrltbSql = "select * from szqdzxindex.dws_itg_idn_bus_app_stat_week where STAT_CYCLE=(select max(STAT_CYCLE) from szqdzxindex.dws_itg_idn_bus_app_stat_week where SHORT_NAME='大连') and disp_no ='11' and SHORT_NAME='大连'";
        Map<String, Object> ljwcrltbSqlRes = dldpResultService.queryInfoBySql2(ljwcrltbSql);
        Map<String, Object> ljwcrltbSqldata = new LinkedHashMap<>();
        ljwcrltbSqldata.put("label", "累计完成容量（万千伏安、万千瓦）");
        ljwcrltbSqldata.put("label1", "高压");
        ljwcrltbSqldata.put("value1", ljwcrltbSqlRes.get("gy"));
        ljwcrltbSqldata.put("label2", "低压");
        ljwcrltbSqldata.put("value2", ljwcrltbSqlRes.get("dy"));
        left_top_2_1.add(ljwcrltbSqldata);

        map2.put("left_top_2_1", left_top_2_1);

        //新装增容（周）
        List<Map<String, Object>> right_top_1 = new ArrayList<>();
        String xzzrsql = "SELECT COUNT(app_no) as APPNO,SUM(app_run_cap)/10000 as CAP FROM szqdzxindex.dws_itg_idn_bus_app_info_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_info_week) " +
                "AND data_type = '本期申请' AND wk_order_name IN ('低压批量新装','低压非居民新装增容','低压居民新装增容')";
        Map<String, Object> xzzrMap = dldpResultService.queryInfoBySql2(xzzrsql);
        String jrztsql = "SELECT COUNT(app_no) as APPNO,SUM(app_run_cap)/10000 as CAP FROM szqdzxindex.dws_itg_idn_bus_app_info_week " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_info_week) AND wk_order_name IN ('销户','减容')";
        Map<String, Object> jrztMap = dldpResultService.queryInfoBySql2(jrztsql);
        Map<String, Object> xzzrData = new LinkedHashMap<>();
        xzzrData.put("label", "新装增容（周）");
        xzzrData.put("value", xzzrMap.get("APPNO"));
        xzzrData.put("unit", "件");
        xzzrData.put("value1", xzzrMap.get("CAP"));
        xzzrData.put("unit1", "万");
        xzzrData.put("unit2", "千伏安");
        right_top_1.add(xzzrData);
        Map<String, Object> jrztxhData = new LinkedHashMap<>();
        jrztxhData.put("label", "减容暂停销户（周）");
        jrztxhData.put("value", jrztMap.get("APPNO"));
        jrztxhData.put("unit", "件");
        jrztxhData.put("value1", jrztMap.get("CAP"));
        jrztxhData.put("unit1", "万");
        jrztxhData.put("unit2", "千伏安");
        right_top_1.add(jrztxhData);

        map2.put("right_top_1", right_top_1);

        //新装增容统计图
        List<Map<String, Object>> right_top_2 = new ArrayList<>();
        List<Map<String, Object>> xzzrMaps = new ArrayList<>();
        List<Map<String, Object>> jrztxhMaps = new ArrayList<>();
        List<List<Map<String, Object>>> top_2_1Data = new ArrayList<>();
        String[] zrjr = new String[]{"沙河口", "中山", "瓦房店", "甘井子", "普兰店", "长兴岛", "庄河", "高新", "金州", "旅顺口", "开发区", "长海县", "开发东部"};

        String xzzrTjtSql = "SELECT SHORT_NAME SHORTNAME,SUM(app_run_cap)/10000 as CAP FROM szqdzxindex.dws_itg_idn_bus_app_info_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_info_week) AND data_type = '本期申请' AND wk_order_name IN ('低压批量新装','低压非居民新装增容','低压居民新装增容') group by SHORT_NAME";
        List<Map<String, Object>> xzzrTjtList = dldpResultService.queryInfoBySql(xzzrTjtSql);

        String jrztTjtSql = "SELECT SHORT_NAME SHORTNAME,SUM(app_run_cap)/10000 as CAP FROM szqdzxindex.dws_itg_idn_bus_app_info_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_bus_app_info_week) AND data_type = '本期申请' AND wk_order_name IN ('低压批量新装','低压非居民新装增容','低压居民新装增容') group by SHORT_NAME";
        List<Map<String, Object>> jrztTjtList = dldpResultService.queryInfoBySql(jrztTjtSql);
        for (int i = 0; i < zrjr.length; i++) {
            Map<String, Object> xzzrTMap = new HashMap<>();
            xzzrTMap.put("name", zrjr[i]);
            xzzrTMap.put("value", "");
            xzzrTMap.put("unit", "");
            for (Map<String, Object> xzzrTjt : xzzrTjtList) {
                if (zrjr[i].equals(xzzrTjt.get("SHORTNAME"))) {
                    //新装增容周
                    xzzrTMap.put("value", new BigDecimal(xzzrTjt.get("CAP").toString()));
                }
            }
            xzzrMaps.add(xzzrTMap);

            Map<String, Object> jrztxhMap = new HashMap<>();
            jrztxhMap.put("name", zrjr[i]);
            jrztxhMap.put("value", "");
            jrztxhMap.put("unit", "");
            for (Map<String, Object> jrztTjt : jrztTjtList) {
                if (zrjr[i].equals(jrztTjt.get("SHORTNAME"))) {
                    jrztxhMap.put("value", new BigDecimal(jrztTjt.get("CAP").toString()).negate());

                }
            }
            jrztxhMaps.add(jrztxhMap);

        }

        top_2_1Data.add(xzzrMaps);
        top_2_1Data.add(jrztxhMaps);
        Map<String, Object> top_2_1 = new HashMap<>();
        top_2_1.put("title", "净增容量变化情况（周）");
        top_2_1.put("legend", new String[]{"新装增容（万千伏安）", "减容暂停销户（万千伏安）"});
        top_2_1.put("data", top_2_1Data);
        right_top_2.add(top_2_1);
        map2.put("right_top_2", right_top_2);


        return map2;
    }

    private Map<String, Object> getStringObjectMapp3_2new() {
        Map<String, Object> mapResult = new HashMap<>();
        List<Map<String, Object>> left_1 = new ArrayList<>();
        //发生95598投诉
        String ts95598 = "select SUM(order_num) orderNum from szqdzxindex.dws_itg_idn_cs_wk_order_stat_week WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) and bus_type='002'";
        Map<String, Object> ts95598Res = dldpResultService.queryInfoBySql2(ts95598);
        Map<String, Object> left_1_ts95598 = new LinkedHashMap<>();
        left_1_ts95598.put("label", "发生95598投诉");
        if (ts95598Res != null) {
            left_1_ts95598.put("value", ts95598Res.get("orderNum") != null ? ts95598Res.get("orderNum") : 0);
        } else {
            left_1_ts95598.put("value", "0");
        }
        left_1_ts95598.put("unit", "");
        left_1.add(left_1_ts95598);

        //发生意见工单
        String yjgdSql = "select SUM(order_num) orderNum from szqdzxindex.dws_itg_idn_cs_wk_order_stat_week WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) and bus_type='001'";
        Map<String, Object> yjgdRes = dldpResultService.queryInfoBySql2(yjgdSql);
        Map<String, Object> left_1_yjgd = new LinkedHashMap<>();
        left_1_yjgd.put("label", "发生意见工单");
        if (left_1_yjgd != null) {
            left_1_yjgd.put("value", yjgdRes.get("orderNum") != null ? yjgdRes.get("orderNum") : 0);
        } else {
            left_1_yjgd.put("value", "0");
        }
        left_1_yjgd.put("unit", "");
        left_1.add(left_1_yjgd);

        //故障处理超时
        String yjclcsSql = "select SUM(order_num) orderNum from szqdzxindex.dws_itg_idn_cs_wk_order_stat_week WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) and bus_type='009'";
        Map<String, Object> yjclcsRes = dldpResultService.queryInfoBySql2(yjclcsSql);
        Map<String, Object> left_1_yjclcs = new LinkedHashMap<>();
        left_1_yjclcs.put("label", "故障处理超时");
        left_1_yjclcs.put("value", yjclcsRes.get("orderNum") != null ? yjclcsRes.get("orderNum") : 0);
        left_1_yjclcs.put("unit", "");
        left_1.add(left_1_yjclcs);

        mapResult.put("left_1", left_1);
        List<Map<String, Object>> left_2 = new ArrayList<>();

        //投诉意见工单最多单位
        String yjtsgdzddwSql = "select short_name shortName,sum(order_num) oredrSum from  szqdzxindex.dws_itg_idn_cs_wk_order_stat_week where  stat_cycle = (SELECT MAX(stat_cycle) from szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) and (bus_type='001' or bus_type='002')  and short_name!='大连'  group by short_name order by sum(order_num) desc limit 1";
        Map<String, Object> yjtsgdzddwRes = dldpResultService.queryInfoBySql2(yjtsgdzddwSql);
        Map<String, Object> yjtsgdzddw = new LinkedHashMap<>();
        yjtsgdzddw.put("label", "投诉意见工单最多单位");
        yjtsgdzddw.put("value", yjtsgdzddwRes.get("shortName"));
        yjtsgdzddw.put("unit", "件");
        left_2.add(yjtsgdzddw);
        //故障处理超时最多单位
        String gzclcszddwSql = "select short_name shortName,sum(order_num) oredrSum from  szqdzxindex.dws_itg_idn_cs_wk_order_stat_week where  stat_cycle = (SELECT MAX(stat_cycle) from szqdzxindex.dws_itg_idn_cs_wk_order_stat_week) and (bus_type='001' or bus_type='002')  and short_name!='大连'  group by short_name order by sum(order_num) desc limit 1";
        Map<String, Object> gzclcszddwRes = dldpResultService.queryInfoBySql2(gzclcszddwSql);
        Map<String, Object> gzclcszddw = new LinkedHashMap<>();
        gzclcszddw.put("label", "故障处理超时最多单位");
        gzclcszddw.put("value", gzclcszddwRes.get("shortName"));
        gzclcszddw.put("unit", "件");
        left_2.add(gzclcszddw);
        mapResult.put("left_2", left_2);


        List<Map<String, Object>> left_3 = new ArrayList<>();
        //用户缴费（年）
        String yhjfSql = "select pay_num/10000 as payNum,num_rate_ly as tb from szqdzxindex.dws_itg_idn_pay_stat_week WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_pay_stat_week) and short_name='大连'";
        Map<String, Object> yhjfRes = dldpResultService.queryInfoBySql2(yhjfSql);
        Map<String, Object> yhjf = new LinkedHashMap<>();
        yhjf.put("label", "用户缴费（年）");
        yhjf.put("value", yhjfRes.get("payNum"));
        yhjf.put("unit", "万笔");
        yhjf.put("label1", "同比");
        yhjf.put("value1", yhjfRes.get("tb"));
        yhjf.put("unit1", "%");
        left_3.add(yhjf);

        //缴费金额（年）
        String jfjeSql = "select pay_amt/100000000 as payAmt,amt_rate_ly as tb from szqdzxindex.dws_itg_idn_pay_stat_week WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_pay_stat_week) and short_name='大连'";
        Map<String, Object> jfjeRes = dldpResultService.queryInfoBySql2(jfjeSql);
        Map<String, Object> jfje = new LinkedHashMap<>();
        jfje.put("label", "缴费金额（年）");
        jfje.put("value", jfjeRes.get("payAmt"));
        jfje.put("unit", "亿元");
        jfje.put("label1", "同比");
        jfje.put("value1", jfjeRes.get("tb"));
        jfje.put("unit1", "%");
        left_3.add(jfje);
        mapResult.put("left_3", left_3);

        List<Map<String, Object>> left_4 = new ArrayList<>();
        //营业厅缴费
        String yytjfSql = "select HALL_num/10000 as hallNum,(HALL_num-HALL_num_LY)/HALL_num_LY as tb from szqdzxindex.dws_itg_idn_channel_stat_week_new WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_channel_stat_week_new) and short_name='大连'";
        Map<String, Object> yytjfRes = dldpResultService.queryInfoBySql2(yytjfSql);
        Map<String, Object> yytjf = new LinkedHashMap<>();
        yytjf.put("label", "营业厅缴费");
        yytjf.put("value", yytjfRes.get("hallNum"));
        yytjf.put("unit", "万笔");
        yytjf.put("label1", "同比");
        yytjf.put("value1", yytjfRes.get("tb"));
        yytjf.put("unit1", "%");
        left_4.add(yytjf);


        //银行缴费
        String left_4_yhjfSql = "select BANK_num/10000 as bankNum,(BANK_num-BANK_num_LY)/BANK_num_LY as tb from szqdzxindex.dws_itg_idn_channel_stat_week_new WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_channel_stat_week_new) and short_name='大连'";
        Map<String, Object> left_4_yhjfRes = dldpResultService.queryInfoBySql2(left_4_yhjfSql);
        Map<String, Object> left_4_yhjf = new LinkedHashMap<>();
        left_4_yhjf.put("label", "银行缴费");
        left_4_yhjf.put("value", left_4_yhjfRes.get("bankNum"));
        left_4_yhjf.put("unit", "万笔");
        left_4_yhjf.put("label1", "同比");
        left_4_yhjf.put("value1", left_4_yhjfRes.get("tb"));
        left_4_yhjf.put("unit1", "%");
        left_4.add(left_4_yhjf);

        //第三方缴费
        String dsfjfSql = "select THIRD_num/10000 as thirdNum,(THIRD_num-THIRD_num_LY)/THIRD_num_LY as tb from szqdzxindex.dws_itg_idn_channel_stat_week_new WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_channel_stat_week_new) and short_name='大连'";
        Map<String, Object> dsfjfRes = dldpResultService.queryInfoBySql2(dsfjfSql);
        Map<String, Object> dsfjf = new LinkedHashMap<>();
        dsfjf.put("label", "第三方缴费");
        dsfjf.put("value", dsfjfRes.get("thirdNum"));
        dsfjf.put("unit", "万笔");
        dsfjf.put("label1", "同比");
        dsfjf.put("value1", dsfjfRes.get("tb"));
        dsfjf.put("unit1", "%");
        left_4.add(dsfjf);

        //互联网缴费
        String hlwjfSql = "select NET_num/10000 as netNum,(NET_num-NET_num_LY)/NET_num_LY as tb from szqdzxindex.dws_itg_idn_channel_stat_week_new WHERE stat_cycle = (SELECT MAX(stat_cycle) FROM szqdzxindex.dws_itg_idn_channel_stat_week_new) and short_name='大连'";
        Map<String, Object> hlwjfRes = dldpResultService.queryInfoBySql2(hlwjfSql);
        Map<String, Object> hlwjf = new LinkedHashMap<>();
        hlwjf.put("label", "互联网缴费");
        hlwjf.put("value", hlwjfRes.get("netNum"));
        hlwjf.put("unit", "万笔");
        hlwjf.put("label1", "同比");
        hlwjf.put("value1", hlwjfRes.get("tb"));
        hlwjf.put("unit1", "%");
        left_4.add(hlwjf);

        mapResult.put("left_4", left_4);

        return mapResult;
    }


    private Map<String, Object> map(String sqlStr) {


        Map<String, Object> cities = new HashMap<>();
        cities.put("changhai", "长海县");
        cities.put("changxingdao", "大连市长兴岛临港工业区");
        cities.put("ganjingzi", "甘井子");
        cities.put("gaoxin", "高新园区");
        cities.put("jinzhou", "大连市金州新区");
        cities.put("kaidong", "大连市开发区东部");
        cities.put("kaifaqu", "大连市开发区");
        cities.put("lvshun", "大连市旅顺口区");
        cities.put("pulandian", "普兰店市");
        cities.put("shahekou", "沙河口");
        cities.put("wafangdian", "瓦房店市");
        cities.put("zhanghe", "庄河市");
        cities.put("zhongshan", "中山");

        String orderStr = "";
        if (sqlStr.equals("xsl>=10")) {
            orderStr = " desc";
        }

        Set<String> keySet = cities.keySet();


        List<Head> heads = new ArrayList<>();
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("xh").width(8).label("序号").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("shortName").width(10).label("公司简称").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("tgNo").width(15).label("台区编号").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("tgName").width(18).label("台区名称").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("PPQ").width(13).label("供电量").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("UPQ").width(13).label("用电量").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("lossPq").width(13).label("损耗电量").build());
        heads.add(Head.builder().id(UUID.randomUUID().toString()).field("llRate").width(10).label("线损率（%）").build());

        String sql2 = "select SHORT_NAME as shortName,TG_NO tgNo,TG_NAME tgName,PPQ,UPQ,LOSS_PQ lossPq,LL_RATE llRate FROM szqdzxindex.dws_itg_idn_tgll_info_week WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_tgll_info_week)  and (SHORT_NAME ='中山' or SHORT_NAME ='庄河市' or SHORT_NAME ='瓦房店市' or SHORT_NAME ='沙河口' or SHORT_NAME ='普兰店市' or SHORT_NAME ='大连市旅顺口区' or SHORT_NAME ='大连市开发区' or SHORT_NAME ='大连市开发区东部' or SHORT_NAME ='大连市金州新区' or SHORT_NAME ='高新园区' or SHORT_NAME ='甘井子' or SHORT_NAME ='大连市长兴岛临港工业区' or SHORT_NAME ='长海县') and " + sqlStr + " order by LL_RATE " + orderStr;
        List<Map<String, Object>> result2 = dldpResultService.queryInfoBySql(sql2);

        Map<String, Object> map2 = new HashMap<>();
        for (String key : keySet) {
            List<Map<String, Object>> list = new ArrayList<>();
            int i = 1;
            for (Map<String, Object> stringObjectMap : result2) {
                if (Objects.equals(stringObjectMap.get("shortName"), cities.get(key))) {
                    stringObjectMap.put("xh", i);
                    list.add(stringObjectMap);
                    i++;
                }
            }
            map2.put(key, list);
        }

        Map<String, Object> m2 = new HashMap<>();
        m2.put("head", heads);
        m2.put("data", map2);

        return m2;
    }

    private final String[] nameArr = new String[]{"电力看产业篇", "电力看经济篇", "供电服务篇", "生产运行篇", "经营管理篇", "前沿技术篇"};

    private void dldlLeftTop1(Map<String, Object> resultMap) {
        String qjnyfdsql = "SELECT SUM(fdl_year)/10000 SUM FROM szqdzxindex.dws_itg_qjnyfd " +
                "WHERE create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd) AND elec_name IN (SELECT elec_name FROM szqdzxindex.dwd_itg_dianchang_dl WHERE type != '火')";
        Map<String, Object> qjnyfdMap = dldpResultService.queryInfoBySql2(qjnyfdsql);
        String qjnyfdzbsql = "SELECT SUM(fdl_year)/10000 SUM FROM szqdzxindex.dws_itg_qjnyfd " +
                "WHERE create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd) AND elec_name IN (SELECT elec_name FROM szqdzxindex.dwd_itg_dianchang_dl)";
        Map<String, Object> qjnyfdzbMap = dldpResultService.queryInfoBySql2(qjnyfdzbsql);

        Double qjnyfd = Double.valueOf(qjnyfdMap.get("SUM").toString());
        Double qjnyfdze = Double.valueOf(qjnyfdzbMap.get("SUM").toString());
        Double qjnyfdzb = qjnyfd * 100 / qjnyfdze;

        String sql = "select zb as value from  dldl_nylxfbqk  where zbqs  = (select max(zbqs) from dldl_nylxfbqk) " +
                "and type  = 1\n" + "UNION ALL\n" + "select SUM(fdl) as value from  dldl_qjnyfdqk  " +
                "where zbqs  = (select max(zbqs)  from dldl_qjnyfdqk) and px!=5 \n" + "UNION ALL\n" + "select  SUM(zs) as value " +
                "from dldl_gdwfbsgffb where zbqs  = (select max(zbqs) from dldl_gdwfbsgffb) and gf_type = 0\n" + "UNION ALL\n" + "select SUM(zs) as value " +
                "from dldl_gdwfbsgffb where zbqs  = (select max(zbqs) from dldl_gdwfbsgffb) and gf_type = 1";
        List<Map<String, Object>> result = queryInfoBySql(sql);
        List<Map<String, Object>> leftTop1 = new ArrayList<>();
        Map<String, Object> map1 = new HashMap<>();
        map1.put("label", "大连地区清洁能源（包含核电）发电量（年）");
        map1.put("value", qjnyfd);
        map1.put("unit1", "亿");
        map1.put("unit2", "千瓦时");
        leftTop1.add(map1);

        map1 = new HashMap<>();
        map1.put("label", "占地区总发电量比例（年）");
        map1.put("value", qjnyfdzb);
        map1.put("unit1", "");
        map1.put("unit2", "%");
        leftTop1.add(map1);

        map1 = new HashMap<>();
        map1.put("label", "大连地区接入分布式光伏（年）");
        map1.put("value", result.get(2).get("value"));
        map1.put("unit1", "");
        map1.put("unit2", "户");
        leftTop1.add(map1);

        map1 = new HashMap<>();
        map1.put("label", "并网容量（年）");
        map1.put("value", result.get(3).get("value"));
        map1.put("unit1", "");
        map1.put("unit2", "千伏安");
        leftTop1.add(map1);

        resultMap.put("left_top_1", leftTop1);
    }

    private void dldlLeftTop2(Map<String, Object> resultMap) {
//        String sql = "SELECT nylx as name,zb as value FROM dldl_nylxfbqk  WHERE zbqs = ( SELECT MAX( zbqs ) FROM dldl_nylxfbqk ) and type = 0 ";
        String sql = "SELECT a.type TYPE,SUM(b.fdl_year) SUM FROM (SELECT elec_name elecname,type type FROM szqdzxindex.dwd_itg_dianchang_dl " +
                "WHERE type in('火','光伏','风电','核电','其他清洁能源')) a " +
                "LEFT JOIN szqdzxindex.dws_itg_qjnyfd b ON a.elecname = b.elec_name AND b.create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd) GROUP BY a.type";
        List<Map<String, Object>> result = queryInfoBySql(sql);

        String zhsql = "SELECT SUM(b.fdl_year) SUM FROM (SELECT elec_name elecname,type type FROM szqdzxindex.dwd_itg_dianchang_dl WHERE type in('火','光伏','风电','核电','其他清洁能源')) a " +
                "LEFT JOIN szqdzxindex.dws_itg_qjnyfd b ON a.elecname = b.elec_name AND b.create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd)";
        Map<String, Object> zhMap = dldpResultService.queryInfoBySql2(zhsql);

        Double zh = Double.valueOf(zhMap.get("SUM").toString());

        List<Map<String, Object>> zbList = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : result) {
            Map<String, Object> dataMap = new HashMap<>();
            dataMap.put("name", stringObjectMap.get("TYPE"));
            dataMap.put("value", Double.valueOf(stringObjectMap.get("SUM").toString()) / zh);
            zbList.add(dataMap);
        }

        Map<String, Object> map = new HashMap<>();
        map.put("title", "大连发电量能源类型分布情况");
        map.put("data", zbList);
        resultMap.put("left_top_2", map);
    }

    private void dldlLeftTop3(Map<String, Object> resultMap) {
        String sql = "SELECT * FROM (SELECT a.type TYPE,COUNT(a.elec_name) as ZUO,ROUND(SUM( b.fdl )/ 10000,2) AS FDL,MAX(CASE a.type WHEN '风电' THEN 1 WHEN '核电' THEN 2 WHEN '光伏' THEN 3 ELSE 4 END ) as SHUNXU " +
                "FROM (SELECT type,elec_name FROM szqdzxindex.dwd_itg_dianchang_dl WHERE type != '火') a LEFT JOIN (SELECT elec_name,MAX(fdl_year) fdl FROM szqdzxindex.dws_itg_qjnyfd " +
                "WHERE create_time = (SELECT MAX(create_time) FROM szqdzxindex.dws_itg_qjnyfd) GROUP BY elec_name) b on a.elec_name = b.elec_name GROUP BY a.type)cc ORDER BY cc.SHUNXU";
        List<Map<String, Object>> result = queryInfoBySql(sql);

        Map<String, Object> leftTop3 = new LinkedHashMap<>();
        List<Map<String, Object>> leftTop3_data = new ArrayList<>();
//        leftTop3.put("label", "向辽宁主网最大外送电力");
//        leftTop3.put("value", result1.get(0).get("fdl"));
//        leftTop3.put("unit", "万千瓦");
        for (Map<String, Object> stringObjectMap : result) {
            Map<String, Object> map1 = new HashMap<>();
            map1.put("label", stringObjectMap.get("TYPE"));
            if (stringObjectMap.get("TYPE").equals("其他清洁能源")) {
                map1.put("value", "");
                map1.put("unit", "");
            } else {
                map1.put("value", stringObjectMap.get("ZUO"));
                map1.put("unit", "座");
            }

            map1.put("value1", stringObjectMap.get("FDL"));
            map1.put("unit1", "亿千瓦时");
            leftTop3_data.add(map1);
        }
        leftTop3.put("data", leftTop3_data);

        resultMap.put("left_top_3", leftTop3);
    }

    private void dldlLeftTop4(Map<String, Object> resultMap) {
        String sql = "SELECT a.* FROM (select  * from dldl_gdwfbsgffb where zbqs  = (select max(zbqs) from dldl_gdwfbsgffb)) a LEFT JOIN dldp_jg b ON a.dw = b.jc WHERE gf_type = 0 AND data_type = 0 ORDER BY b.px + 0";
        List<Map<String, Object>> result1 = dldlLeftTop4GetData(dldpResultService.queryInfoBySql(sql));

        sql = "SELECT a.* FROM (select  * from dldl_gdwfbsgffb where zbqs  = (select max(zbqs) from dldl_gdwfbsgffb)) a LEFT JOIN dldp_jg b ON a.dw = b.jc WHERE gf_type = 0 AND data_type = 1 ORDER BY b.px + 0";
        List<Map<String, Object>> result2 = dldlLeftTop4GetData(dldpResultService.queryInfoBySql(sql));

        sql = "SELECT a.* FROM (select  * from dldl_gdwfbsgffb where zbqs  = (select max(zbqs) from dldl_gdwfbsgffb)) a LEFT JOIN dldp_jg b ON a.dw = b.jc WHERE gf_type = 1 AND data_type = 0 ORDER BY b.px + 0";
        List<Map<String, Object>> result3 = dldlLeftTop4GetData(dldpResultService.queryInfoBySql(sql));

        sql = "SELECT a.* FROM (select  * from dldl_gdwfbsgffb where zbqs  = (select max(zbqs) from dldl_gdwfbsgffb)) a LEFT JOIN dldp_jg b ON a.dw = b.jc WHERE gf_type = 1 AND data_type = 1 ORDER BY b.px + 0";
        List<Map<String, Object>> result4 = dldlLeftTop4GetData(dldpResultService.queryInfoBySql(sql));

        Map<String, Object> map1 = new HashMap<>();
        map1.put("data", new Object[]{result1, result2});
        map1.put("label", "户数");
        map1.put("legend", new String[]{"自然人光伏户数（户）", "非自然人光伏户数（户）"});

        Map<String, Object> map2 = new HashMap<>();
        map2.put("data", new Object[]{result3, result4});
        map2.put("label", "并网容量");
        map2.put("legend", new String[]{"并网容量1", "并网容量2"});

        Map<String, Object> map3 = new HashMap<>();
        map3.put("data", new Object[]{map1, map2});
        map3.put("title", "各单位分布式光伏分布情况");
        resultMap.put("left_top_4", map3);
    }

    private void dldlRightTop1(Map<String, Object> resultMap) {
        String sql = "SELECT dzsm label,dzsl AS 'value','座' unit,dzjtsm label1,dzjtms value1,CONCAT(' " + serviceUrl + "'" + ", img_url ) img " + " FROM dldl_cndzxx WHERE zbqs = ( SELECT MAX( zbqs )  FROM dldl_cndzxx )";
        resultMap.put("right_top_1", queryInfoBySql(sql));
    }

    private List<Map<String, Object>> dldlLeftTop4GetData(List<Map<String, Object>> result) {
        List<Map<String, Object>> resultMap = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : result) {
            Map<String, Object> map1 = new HashMap<>();
            map1.put("name", stringObjectMap.get("dw"));
            map1.put("value", stringObjectMap.get("zs"));
            resultMap.add(map1);
        }
        return resultMap;
    }

    private void ywjxOneLeftTop1(Map<String, Object> resultMap) {

        String zxxczysql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xczy WHERE zyrq > " +
                "(SELECT DATE_SUB(MAX(zyrq),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xczy)";
        Map<String, Object> zxxczyMap = dldpResultService.queryInfoBySql2(zxxczysql);

        String grade3sql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xczy " +
                "WHERE zyrq > (SELECT DATE_SUB(MAX(zyrq),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xczy) AND fxdj IN ('一级','二级','三级')";
        Map<String, Object> grade3Map = dldpResultService.queryInfoBySql2(grade3sql);

        String ddpsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xczy " +
                "WHERE zyrq > (SELECT DATE_SUB(MAX(zyrq),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xczy) AND gzp = '带电票'";
        Map<String, Object> ddpMap = dldpResultService.queryInfoBySql2(ddpsql);

        String sql = "select IFNULL(zyl,0)zyl,IFNULL(szyl,0)szyl,IFNULL(zywz,0)zywz  from ywjx_xczy where nyz = (select MAX(nyz) from ywjx_xczy where t_type=0 ) and t_type = 0 ";
        List<Map<String, Object>> result = queryInfoBySql(sql);
        Map<String, Object> d1 = new HashMap<>();
        d1.put("label", "执行现场作业（周）");
        d1.put("value", zxxczyMap.get("COUNT"));
        d1.put("unit", "项次");

        Map<String, Object> d2 = new LinkedHashMap<>();
        d2.put("label", "三级及以上作业风险（周）");
        d2.put("value", grade3Map.get("COUNT"));
        d2.put("unit", "项次");

        Map<String, Object> d3 = new LinkedHashMap<>();
        d3.put("label", "带电作业（周）");
        d3.put("value", ddpMap.get("COUNT"));
        d3.put("unit", "次");

        List<Map<String, Object>> leftTop1 = new ArrayList<>();
        leftTop1.add(d1);
        leftTop1.add(d2);
        leftTop1.add(d3);
        resultMap.put("left_top_1", leftTop1);
    }

    private void ywjxOneLeftTop2(Map<String, Object> resultMap) {
        String xczym = "SELECT DATE_FORMAT(zyrq,'%Y-%m') MONTH,COUNT(*) COUNT FROM szqdzxindex.dws_itg_xczy " +
                "WHERE zyrq > (SELECT DATE_FORMAT(DATE_SUB(MAX(zyrq),INTERVAL 1 YEAR),'%Y-%m-01 00:00:00') " +
                "FROM szqdzxindex.dws_itg_xczy) GROUP BY DATE_FORMAT(zyrq,'%Y-%m') ORDER BY DATE_FORMAT(zyrq,'%Y-%m')";
        List<Map<String, Object>> xczymRes = queryInfoBySql(xczym);
        Map<String, Object> mData = new LinkedHashMap<>();
        List<Map<String, Object>> mDataList = new ArrayList<>();
        for (Map<String, Object> res : xczymRes) {
            Map<String, Object> m = new LinkedHashMap<>();
            m.put("name", res.get("MONTH"));
            m.put("value", res.get("COUNT"));
            m.put("unit", "");
            mDataList.add(m);
        }
        mData.put("label", "月作业量统计");
        mData.put("legend", new String[]{"月作业量（次）"});
        mData.put("data", new Object[]{mDataList});

        Map<String, Object> leftTop2 = new LinkedHashMap<>();
        List<Map<String, Object>> leftTop2Data = new ArrayList<>();
        leftTop2Data.add(mData);
        leftTop2.put("title", "大连现场作业趋势变化情况");
        leftTop2.put("data", leftTop2Data);
        resultMap.put("left_top_2", leftTop2);
    }

    private void ywjxOneRightTop1(Map<String, Object> resultMap) {
        String xltdsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xltd WHERE gzlx in ('接地故障','重合良好','重合不良') " +
                "and sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xltd)";
        Map<String, Object> xltdMap = dldpResultService.queryInfoBySql2(xltdsql);
        String xltdLastsql = "SELECT COUNT(*) as COUNT FROM szqdzxindex.dws_itg_xltd " +
                "WHERE gzlx in ('接地故障','重合良好','重合不良') and sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 14 DAY) FROM szqdzxindex.dws_itg_xltd) " +
                "AND sjsj <=  (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xltd)";
        Map<String, Object> xltdLastMap = dldpResultService.queryInfoBySql2(xltdLastsql);

        Double xltdValue = Double.valueOf(xltdMap.get("COUNT").toString());
        Double xltdLastValue = Double.valueOf(xltdLastMap.get("COUNT").toString());
        Double xltdHbValue = (xltdValue - xltdLastValue) * 100 / xltdLastValue;

        List<Map<String, Object>> rightTop1 = new ArrayList<>();
        Map<String, Object> xltdData = new LinkedHashMap<>();
        Map<String, Object> xltdhbData = new LinkedHashMap<>();
        xltdData.put("label", "10千伏线路停电（周）");
        xltdData.put("value", xltdValue);
        xltdData.put("unit", "条次");
        xltdhbData.put("label", "环比");
        xltdhbData.put("value", xltdHbValue);
        xltdhbData.put("unit", "%");
        rightTop1.add(xltdData);
        rightTop1.add(xltdhbData);
        resultMap.put("right_top_1", rightTop1);
    }

    private void ywjxOneRightTop2(Map<String, Object> resultMap) {
        String sql1 = "SELECT * FROM (SELECT DISTINCT REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','') QX,ssqx FROM " +
                "szqdzxindex.dws_itg_xltd) a LEFT JOIN (SELECT REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','') QX,count(*) count " +
                "FROM szqdzxindex.dws_itg_xltd WHERE gzlx in ('重合不良') and sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xltd) " +
                "GROUP BY REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','')) b on a.QX = b.QX";
        List<Map<String, Object>> result1 = queryInfoBySql(sql1);
        String sql2 = "SELECT * FROM (SELECT DISTINCT REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','') QX,ssqx FROM " +
                "szqdzxindex.dws_itg_xltd) a LEFT JOIN (SELECT REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','') QX,count(*) count " +
                "FROM szqdzxindex.dws_itg_xltd WHERE gzlx in ('重合良好') and sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xltd) " +
                "GROUP BY REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','')) b on a.QX = b.QX";
        List<Map<String, Object>> result2 = queryInfoBySql(sql2);
        String sql3 = "SELECT * FROM (SELECT DISTINCT REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','') QX,ssqx FROM " +
                "szqdzxindex.dws_itg_xltd) a LEFT JOIN (SELECT REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','') QX,count(*) count " +
                "FROM szqdzxindex.dws_itg_xltd WHERE gzlx in ('接地故障') and sjsj > (SELECT DATE_SUB(MAX(sjsj),INTERVAL 7 DAY) FROM szqdzxindex.dws_itg_xltd) " +
                "GROUP BY REPLACE(REPLACE(REPLACE(ssqx,'国网',''),'供电公司',''),'供电分公司','')) b on a.QX = b.QX";
        List<Map<String, Object>> result3 = queryInfoBySql(sql3);


        Map<String, Object> map = new HashMap<>();
        map.put("label", "配电线路故障（周）");
        map.put("legend", new String[]{"重合不良（次）", "重合良好（次）", "接地故障（次）"});
        List<List<Map<String, Object>>> data = new ArrayList<>();
        List<Map<String, Object>> d1 = new ArrayList<>();
        data.add(d1);
        List<Map<String, Object>> d2 = new ArrayList<>();
        data.add(d2);
        List<Map<String, Object>> d3 = new ArrayList<>();
        data.add(d3);
        for (Map<String, Object> stringObjectMap : result1) {
            Map<String, Object> m1 = new HashMap<>();
            m1.put("name", isNullValue(stringObjectMap, "QX"));
            m1.put("value", new BigDecimal(isNullValue(stringObjectMap, "count").toString()));
            d1.add(m1);
        }
        for (Map<String, Object> stringObjectMap : result2) {
            Map<String, Object> m2 = new HashMap<>();
            m2.put("name", isNullValue(stringObjectMap, "QX"));
            m2.put("value", new BigDecimal(isNullValue(stringObjectMap, "count").toString()));
            d2.add(m2);
        }
        for (Map<String, Object> stringObjectMap : result3) {
            Map<String, Object> m3 = new HashMap<>();
            m3.put("name", isNullValue(stringObjectMap, "QX"));
            m3.put("value", new BigDecimal(isNullValue(stringObjectMap, "count").toString()));
            d3.add(m3);
        }
        map.put("data", data);
        resultMap.put("right_top_2", map);
    }

    private void ywjxTwoLeftTop1(Map<String, Object> resultMap) {

        String qxgdsql = "SELECT HJ_NUM as HJNUM,BXL_RATE BXLRATE FROM szqdzxindex.dws_itg_idn_fault_stat_week WHERE " +
                "STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_stat_week) and SHORT_NAME = '大连'";
        Map<String, Object> qxgdMap = dldpResultService.queryInfoBySql2(qxgdsql);

        Map<String, Object> leftTop1 = new HashMap<>();
        leftTop1.put("label", "95598抢修工单（周）");
        leftTop1.put("value", qxgdMap.get("HJNUM"));
        leftTop1.put("unit", "件");
        Map<String, Object> leftTop2 = new HashMap<>();
        leftTop2.put("label", "每十万户\n报修数量");
        leftTop2.put("value", qxgdMap.get("BXLRATE"));

        String pjddxcscsql = "SELECT AVG_ARV_MITS  PJDD,AVG_RECO_MITS QXPJ FROM szqdzxindex.dws_itg_idn_fault_times " +
                "WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_times) and SHORT_NAME = '大连'";
        Map<String, Object> pjddxcscMap = dldpResultService.queryInfoBySql2(pjddxcscsql);

        Map<String, Object> leftTop3 = new HashMap<>();
        leftTop3.put("label", "平均到达现场时长");
        leftTop3.put("value", pjddxcscMap.get("PJDD"));
        leftTop3.put("unit", "分钟");
        Map<String, Object> leftTop4 = new HashMap<>();
        leftTop4.put("label", "抢修平均修复时长");
        leftTop4.put("value", pjddxcscMap.get("QXPJ"));
        leftTop4.put("unit", "分钟");

        resultMap.put("left_top_1", new Object[]{leftTop1, leftTop2, leftTop3, leftTop4});
    }

    private void ywjxTwoLeftTop2(Map<String, Object> resultMap) {
        String qxgdsql = "SELECT * FROM szqdzxindex.dws_itg_idn_fault_stat_week WHERE STAT_CYCLE = " +
                "(SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_stat_week) and SHORT_NAME = '大连'";
        Map<String, Object> qxgdMap = dldpResultService.queryInfoBySql2(qxgdsql);

        Map<String, Object> map = new HashMap<>();
        map.put("label", "故障报修类型统计（周）");
        map.put("legend", new String[]{});
        List<List<Map<String, Object>>> data = new ArrayList<>();
        List<Map<String, Object>> d1 = new ArrayList<>();
        data.add(d1);
        Map<String, Object> m1 = new HashMap<>();
        if (Integer.parseInt(qxgdMap.get("DY_NUM").toString()) > 0) {
            m1.put("name", "低压故障");
            m1.put("value", isNullValue(qxgdMap, "DY_NUM"));
            m1.put("unit", "件");
            d1.add(m1);
        }
        if (Integer.parseInt(qxgdMap.get("FDL_NUM").toString()) > 0) {
            Map<String, Object> m2 = new HashMap<>();
            m2.put("name", "非电力故障");
            m2.put("value", isNullValue(qxgdMap, "FDL_NUM"));
            m2.put("unit", "件");
            d1.add(m2);
        }
        if (Integer.parseInt(qxgdMap.get("GY_NUM").toString()) > 0) {
            Map<String, Object> m3 = new HashMap<>();
            m3.put("name", "高压故障");
            m3.put("value", isNullValue(qxgdMap, "GY_NUM"));
            m3.put("unit", "件");
            d1.add(m3);
        }
        if (Integer.parseInt(qxgdMap.get("DNZL_NUM").toString()) > 0) {
            Map<String, Object> m4 = new HashMap<>();
            m4.put("name", "电能质量");
            m4.put("value", isNullValue(qxgdMap, "DNZL_NUM"));
            m4.put("unit", "件");
            d1.add(m4);
        }
        if (Integer.parseInt(qxgdMap.get("JL_NUM").toString()) > 0) {
            Map<String, Object> m5 = new HashMap<>();
            m5.put("name", "计量故障");
            m5.put("value", isNullValue(qxgdMap, "JL_NUM"));
            m5.put("unit", "件");
            d1.add(m5);
        }
        if (Integer.parseInt(qxgdMap.get("TDYY_NUM").toString()) > 0) {
            Map<String, Object> m6 = new HashMap<>();
            m6.put("name", "停电查询");
            m6.put("value", isNullValue(qxgdMap, "TDYY_NUM"));
            m6.put("unit", "件");
            d1.add(m6);
        }

        map.put("data", data);

        String qxgdchart1sql = "SELECT * FROM szqdzxindex.dws_itg_idn_fault_stat_week WHERE STAT_CYCLE = " +
                "(SELECT MAX(STAT_CYCLE) FROM szqdzxindex.dws_itg_idn_fault_stat_week) and SHORT_NAME != '大连'";
        List<Map<String, Object>> qxgdchart1Map = queryInfoBySql(qxgdchart1sql);
        Map<String, Object> map2 = new HashMap<>();
        map2.put("label", "故障报修量统计（周）");
        map2.put("legend", new String[]{"报修合计（件）", "每十万户报修率（户）"});
        List<List<Map<String, Object>>> data2 = new ArrayList<>();
        List<Map<String, Object>> a1 = new ArrayList<>();
        data2.add(a1);
        List<Map<String, Object>> a2 = new ArrayList<>();
        data2.add(a2);
        for (Map<String, Object> stringObjectMap : qxgdchart1Map) {
            Map<String, Object> m18 = new HashMap<>();
            m18.put("name", isNullValue(stringObjectMap, "SHORT_NAME"));
            m18.put("value", isNullValue(stringObjectMap, "HJ_NUM"));
            a1.add(m18);
            Map<String, Object> m2 = new HashMap<>();
            m2.put("name", isNullValue(stringObjectMap, "SHORT_NAME"));
            m2.put("value", isNullValue(stringObjectMap, "BXL_RATE"));
            a2.add(m2);

        }
        map2.put("data", data2);

        String qxgdchart2sql = "SELECT * FROM szqdzxindex.dws_itg_idn_fault_times WHERE STAT_CYCLE = (SELECT MAX(STAT_CYCLE) " +
                "FROM szqdzxindex.dws_itg_idn_fault_times) and SHORT_NAME != '大连'";
        List<Map<String, Object>> qxgdchart2Map = queryInfoBySql(qxgdchart2sql);

        Map<String, Object> map3 = new HashMap<>();
        map3.put("label", "故障抢修修复时长（周）");
        map3.put("legend", new String[]{"本期修复时长（分）"});
        List<List<Map<String, Object>>> data3 = new ArrayList<>();
        List<Map<String, Object>> b1 = new ArrayList<>();
        data3.add(b1);
        for (Map<String, Object> stringObjectMap : qxgdchart2Map) {
            Map<String, Object> m19 = new HashMap<>();
            m19.put("name", isNullValue(stringObjectMap, "SHORT_NAME"));
            m19.put("value", isNullValue(stringObjectMap, "AVG_RECO_MITS"));
            b1.add(m19);
        }
        map3.put("data", data3);
        resultMap.put("left_top_2", new Object[]{map, map2, map3});
    }

    private void ywjxTwoRightTop2(Map<String, Object> resultMap) {
        String sql = "select * from ywjx_sykk  where zbqs = (select MAX(zbqs) from ywjx_sykk ) order by type";
        List<Map<String, Object>> result = queryInfoBySql(sql);

        Map<String, Object> m1 = new HashMap<>();
        m1.put("label", "自动化\n覆盖率");
        m1.put("value", isNullValue(result.get(0), "value1"));
        m1.put("unit", "%");
        Map<String, Object> m2 = new HashMap<>();
        m2.put("label", result.get(0).get("label2"));
        m2.put("value", isNullValue(result.get(0), "value2"));
        m2.put("unit", "条");
        Map<String, Object> m3 = new HashMap<>();
        m3.put("label", result.get(0).get("label3"));
        m3.put("value", isNullValue(result.get(0), "value3"));
        m3.put("unit", "条");
        m1.put("data", new Object[]{m2, m3});

        Map<String, Object> m4 = new HashMap<>();
        m4.put("label", "终端\n在线率");
        m4.put("value", isNullValue(result.get(1), "value1"));
        m4.put("unit", "%");
        Map<String, Object> m5 = new HashMap<>();
        m5.put("label", result.get(1).get("label2"));
        m5.put("value", isNullValue(result.get(1), "value2"));
        m5.put("unit", "次");
        Map<String, Object> m6 = new HashMap<>();
        m6.put("label", result.get(1).get("label3"));
        m6.put("value", isNullValue(result.get(1), "value3"));
        m6.put("unit", "次");
        m4.put("data", new Object[]{m5, m6});

        Map<String, Object> m7 = new HashMap<>();
        m7.put("label", "终端遥控\n使用率");
        m7.put("value", isNullValue(result.get(2), "value1"));
        m7.put("unit", "%");
        Map<String, Object> m8 = new HashMap<>();
        m8.put("label", result.get(2).get("label2"));
        m8.put("value", isNullValue(result.get(2), "value2"));
        m8.put("unit", "条");
        Map<String, Object> m9 = new HashMap<>();
        m9.put("label", result.get(2).get("label3"));
        m9.put("value", isNullValue(result.get(2), "value3"));
        m9.put("unit", "条");
        m7.put("data", new Object[]{m8, m9});

        Map<String, Object> m10 = new HashMap<>();
        m10.put("label", "终端遥控\n成功率");
        m10.put("value", isNullValue(result.get(3), "value1"));
        m10.put("unit", "%");
        Map<String, Object> m11 = new HashMap<>();
        m11.put("label", result.get(3).get("label2"));
        m11.put("value", isNullValue(result.get(3), "value2"));
        m11.put("unit", "条");
        Map<String, Object> m12 = new HashMap<>();
        m12.put("label", result.get(3).get("label3"));
        m12.put("value", isNullValue(result.get(3), "value3"));
        m12.put("unit", "条");
        m10.put("data", new Object[]{m11, m12});

        Map<String, Object> m13 = new HashMap<>();
        m13.put("label", "馈线自动化\n动作正确率");
        m13.put("value", isNullValue(result.get(4), "value1"));
        m13.put("unit", "%");
        Map<String, Object> m14 = new HashMap<>();
        m14.put("label", result.get(4).get("label2"));
        m14.put("value", isNullValue(result.get(4), "value2"));
        m14.put("unit", "条");
        Map<String, Object> m15 = new HashMap<>();
        m15.put("label", result.get(4).get("label3"));
        m15.put("value", isNullValue(result.get(4), "value3"));
        m15.put("unit", "条");
        m13.put("data", new Object[]{m14, m15});

        resultMap.put("right_top_2", new Object[]{m1, m4, m7, m10, m13});
    }

    private void ywjxTwoRightTop1(Map<String, Object> resultMap) {
        String sql = "select '三遥可控开关'label,'台' unit ,value2 value from ywjx_sykk  where zbqs = (select MAX(zbqs) from ywjx_sykk ) and type = 6";
        resultMap.put("right_top_1", dldpResultService.queryInfoBySql2(sql));

    }

    private List<Map<String, Object>> queryInfoBySql(String sql) {
        return dldpResultService.queryInfoBySql(sql);
    }

    private Object isNullValue(Map<String, Object> map, String key) {
        return map.get(key) != null ? map.get(key) : 0;
    }

    @RequestMapping("getPptJson")
    @ResponseBody
    public Map<String, Object> getPptJson() {
        //--------------原有逻辑START--------------------
//        Map<String, Object> map2 = new LinkedHashMap<>();
//
//        List<String> dataList_1_images = new ArrayList<>();
//        String sql2 = "SELECT  tplj , CONCAT( 'http://10.161.33.86:18080/dldpPro/', tplj ) img " +
//                " FROM  dldp_tplj  WHERE lx = '11'";
//        List<Map<String, Object>> images1 = dldpResultService.queryInfoBySql(sql2);
//        for (Map<String, Object> stringObjectMap : images1) {
//            dataList_1_images.add(stringObjectMap.get("img").toString());
//        }
//        map2.put("ppt", dataList_1_images);
//        Map<String, Object> map = new LinkedHashMap<>();
//        map.put("data", map2);
//        map.put("code", 200);
//        return map;
        //--------------原有逻辑END--------------------
        Map<String, Object> map2 = new LinkedHashMap<>();
        List<Map<String, Object>> gotoList = new ArrayList<>();

        Map<String, Object> goto_1 = new LinkedHashMap<>();
        goto_1.put("label", "战略统筹");
        List<String> pptList = new ArrayList<>();
        String zltcsql = "SELECT  tplj , CONCAT( 'http://" + URL + "', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = 'zltc'";
        List<Map<String, Object>> zltcList = dldpResultService.queryInfoBySql(zltcsql);
        for (Map<String, Object> stringObjectMap : zltcList) {
            pptList.add(stringObjectMap.get("img").toString());
        }
        goto_1.put("data", pptList);
        gotoList.add(goto_1);

        Map<String, Object> goto_2 = new LinkedHashMap<>();
        goto_2.put("label", "赋能赋效");
        List<String> pptList2 = new ArrayList<>();
        String fnfxsql = "SELECT  tplj , CONCAT( 'http://" + URL + "', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = 'fnfx'";
        List<Map<String, Object>> fnfxList = dldpResultService.queryInfoBySql(fnfxsql);
        for (Map<String, Object> stringObjectMap : fnfxList) {
            pptList2.add(stringObjectMap.get("img").toString());
        }
        goto_2.put("data", pptList2);
        gotoList.add(goto_2);


        Map<String, Object> goto_3 = new LinkedHashMap<>();
        goto_3.put("label", "展望未来");
        List<String> pptList3 = new ArrayList<>();
        String zwwlsql = "SELECT  tplj , CONCAT( 'http://" + URL + "', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = 'zwwl'";
        List<Map<String, Object>> zwwlList = dldpResultService.queryInfoBySql(zwwlsql);
        for (Map<String, Object> stringObjectMap : zwwlList) {
            pptList3.add(stringObjectMap.get("img").toString());
        }
        goto_3.put("data", pptList3);
        gotoList.add(goto_3);

        map2.put("ppt", gotoList);
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("data", map2);
        map.put("code", 200);
        return map;
    }

    @RequestMapping("getEndJson")
    @ResponseBody
    public Map<String, Object> getEndJson() {
        Map<String, Object> map2 = new LinkedHashMap<>();
        String sql1 = "SELECT  tplj , CONCAT( 'http://10.161.33.86:18080/dldpPro/', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = '5'";
        List<Map<String, Object>> introList = dldpResultService.queryInfoBySql(sql1);
        List<String> imgList = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : introList) {
            imgList.add(stringObjectMap.get("img").toString());
        }
        map2.put("img", imgList);
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("data", map2);
        map.put("code", 200);
        return map;
    }

    @RequestMapping("getHelloJson")
    @ResponseBody
    public Map<String, Object> getHelloJson() {
        Map<String, Object> map2 = new LinkedHashMap<>();
        String sql1 = "SELECT  tplj , CONCAT( 'http://" + URL + "', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = '7'";
        List<Map<String, Object>> introList = dldpResultService.queryInfoBySql(sql1);
        map2.put("src", introList.get(0).get("img").toString());
        List<Map<String, Object>> gotoList = new ArrayList<>();
        Map<String, Object> goto_1 = new LinkedHashMap<>();
        goto_1.put("keycode", "1");
        goto_1.put("pageIndex", 0);
        goto_1.put("subIndex", 0);

        Map<String, Object> goto_2 = new LinkedHashMap<>();
        goto_2.put("keycode", "2");
        goto_2.put("pageIndex", 1);
        goto_2.put("subIndex", 0);
        Map<String, Object> goto_3 = new LinkedHashMap<>();
        goto_3.put("keycode", "3");
        goto_3.put("pageIndex", -1);
        goto_3.put("subIndex", 2);
        Map<String, Object> goto_4 = new LinkedHashMap<>();
        goto_4.put("keycode", "4");
        goto_4.put("pageIndex", -1);
        goto_4.put("subIndex", 3);
        Map<String, Object> goto_5 = new LinkedHashMap<>();
        goto_5.put("keycode", "5");
        goto_5.put("pageIndex", 6);
        goto_5.put("subIndex", 0);
        Map<String, Object> goto_6 = new LinkedHashMap<>();
        goto_6.put("keycode", "6");
        goto_6.put("pageIndex", 2);
        goto_6.put("subIndex", 0);
        Map<String, Object> goto_7 = new LinkedHashMap<>();
        goto_7.put("keycode", "7");
        goto_7.put("pageIndex", 4);
        goto_7.put("subIndex", 0);
        gotoList.add(goto_1);
        gotoList.add(goto_2);
        gotoList.add(goto_3);
        gotoList.add(goto_4);
        gotoList.add(goto_5);
        gotoList.add(goto_6);
        gotoList.add(goto_7);
        map2.put("goto", gotoList);

        String hellosql = "SELECT  tplj , CONCAT( 'http://" + URL + "', tplj ) img " +
                " FROM  dldp_tplj  WHERE lx = 'hello'";
        List<Map<String, Object>> hellopptList = dldpResultService.queryInfoBySql(hellosql);
        List<String> pptList = new ArrayList<>();
        for (Map<String, Object> stringObjectMap : hellopptList) {
            pptList.add(stringObjectMap.get("img").toString());
        }
        map2.put("ppt", pptList);


        Map<String, Object> map = new LinkedHashMap<>();
        map.put("data", map2);
        map.put("code", 200);
        return map;
    }

}
